pub struct RuntimeStopHandle { /* private fields */ }Expand description
An opaque, cloneable, thread-safe stop handle for external cooperative stop.
Wraps an Arc<AtomicBool>. Calling request_stop() sets the flag;
is_stopping() reads it. Safe to send to another thread and use while
LimenRuntime::run() holds &mut self.
Implementations§
Source§impl RuntimeStopHandle
impl RuntimeStopHandle
Sourcepub fn new(flag: Arc<AtomicBool>) -> Self
pub fn new(flag: Arc<AtomicBool>) -> Self
Create a new stop handle wrapping the given atomic flag.
Sourcepub fn request_stop(&self)
pub fn request_stop(&self)
Request cooperative stop (visible to the runtime’s scheduler).
Sourcepub fn is_stopping(&self) -> bool
pub fn is_stopping(&self) -> bool
Return true if stop has been requested.
Trait Implementations§
Source§impl Clone for RuntimeStopHandle
impl Clone for RuntimeStopHandle
Source§fn clone(&self) -> RuntimeStopHandle
fn clone(&self) -> RuntimeStopHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RuntimeStopHandle
impl RefUnwindSafe for RuntimeStopHandle
impl Send for RuntimeStopHandle
impl Sync for RuntimeStopHandle
impl Unpin for RuntimeStopHandle
impl UnsafeUnpin for RuntimeStopHandle
impl UnwindSafe for RuntimeStopHandle
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