pub struct Stopper { /* private fields */ }
Expand description
A basic cancellation-token
Used to terminate (and signal termination of) worker tasks
Implementations§
Source§impl Stopper
impl Stopper
Sourcepub async fn wait_stopped(&self)
pub async fn wait_stopped(&self)
Wait until the stopper has been stopped.
Once this completes, the stopper has been permanently stopped
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Have we been stopped?
Sourcepub fn stop(&self)
pub fn stop(&self)
Stop the stopper
All current and future calls to Self::wait_stopped will complete immediately
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stopper
impl !RefUnwindSafe for Stopper
impl Send for Stopper
impl Sync for Stopper
impl Unpin for Stopper
impl !UnwindSafe for Stopper
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