pub struct RuntimeLoop { /* private fields */ }Implementations§
Source§impl RuntimeLoop
impl RuntimeLoop
Sourcepub fn get_cancel_flag(&self) -> Arc<AtomicBool>
pub fn get_cancel_flag(&self) -> Arc<AtomicBool>
Sometimes we want to be able to cancel the loop from the outside. Before we start this loop in its own thread with run(), we can grab the cancel_flag and set it to true.
Sourcepub fn add_pollable(&mut self, pollable: Arc<Mutex<dyn PollableTrait>>)
pub fn add_pollable(&mut self, pollable: Arc<Mutex<dyn PollableTrait>>)
The runtime loop will continue to check a list of pollable closures. This is how you add such a closure.
Auto Trait Implementations§
impl Freeze for RuntimeLoop
impl RefUnwindSafe for RuntimeLoop
impl Send for RuntimeLoop
impl Sync for RuntimeLoop
impl Unpin for RuntimeLoop
impl UnsafeUnpin for RuntimeLoop
impl UnwindSafe for RuntimeLoop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more