pub struct Cancel(/* private fields */);Expand description
A handle that stops the runs that watch it.
A run watches a cancel that
RunOptions::cancel gave it.
Cancel::cancel stops each watching run with its escalation, and the
run ends as Stopped(Cancelled). A run that
starts with a cancel that is already cancelled starts no child. Clones
share one state, so any clone cancels, and a cancel stays cancelled.
Implementations§
Source§impl Cancel
impl Cancel
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels every run that watches this cancel or that starts watching it later.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns true once Cancel::cancel has been called on this cancel or
a clone of it.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Cancel
impl Freeze for Cancel
impl RefUnwindSafe for Cancel
impl Send for Cancel
impl Sync for Cancel
impl Unpin for Cancel
impl UnsafeUnpin for Cancel
impl UnwindSafe for Cancel
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