/// Run this event loop
///
/// This will repeatedly try to dispatch events (see the `dispatch()` method) on
/// this event loop, waiting at most `timeout` every time.
///
/// Between each dispatch wait, your provided callback will be called.
///
/// You can use the `get_signal()` method to retrieve a way to stop or wakeup
/// the event loop from anywhere.
Run this event loop
This will repeatedly try to dispatch events ` method) on
this event loop, waiting at most `timeout` every time.

Between each dispatch wait, your provided callback will be called.

You can use the `get_signal()` method to retrieve a way to stop or wakeup
the event loop from anywhere.
Run this event loop This will repeatedly try to dispatch events ` method ) on this event loop waiting at most ` timeout ` every time . Between each dispatch wait your provided callback will be called . You can use the ` get_signal () ` method to retrieve a way to stop or wakeup the event loop from anywhere .
pub fn run<F, D: Into<Option<Duration>>>(
        &mut self,
        timeout: D,
        data: &mut Data,
        mut cb: F,
    ) -> io::Result<()>
    where
        F: FnMut(&mut Data),
    {
        let timeout = timeout.into();
        self.stop_signal.store(false, Ordering::Release);
        while !self.stop_signal.load(Ordering::Acquire) {
            self.dispatch(timeout, data)?;
            cb(data);
        }
        Ok(())
    }
pub fn run < F , D : Into < Option < Duration > > > ( & mut self , timeout : D , data : & mut Data , mut cb : F , ) -> io :: Result < ( ) > where F : FnMut ( & mut Data ) , { let timeout = timeout . into ( ) ; self . stop_signal . store ( false , Ordering :: Release ) ; while ! self . stop_signal . load ( Ordering :: Acquire ) { self . dispatch ( timeout , data ) ? ; cb ( data ) ; } Ok ( ( ) ) }
Run this event loop
This will repeatedly try to dispatch events (see the `dispatch()` method) on
this event loop, waiting at most `timeout` every time.
Run this event loop This will repeatedly try to dispatch events ( see the ` dispatch () ` method ) on this event loop waiting at most ` timeout ` every time .
&mut self
timeout
D
data
&mut Data
cb
F