pub struct CancelHandle(/* private fields */);Expand description
Cancels a Run from outside, such as from another task while the run is
being driven. Cloneable and cheap.
Implementations§
Source§impl CancelHandle
impl CancelHandle
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Cancels the run: it stops at its next await point and ends with
RunOutcome::Cancelled. Calling it again, or after the run ended,
does nothing.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether the run was cancelled.
Trait Implementations§
Source§impl Clone for CancelHandle
impl Clone for CancelHandle
Source§impl Debug for CancelHandle
impl Debug for CancelHandle
Auto Trait Implementations§
impl Forget for CancelHandle
impl Freeze for CancelHandle
impl Move for CancelHandle
impl RefUnwindSafe for CancelHandle
impl Send for CancelHandle
impl Sync for CancelHandle
impl Unpin for CancelHandle
impl UnsafeUnpin for CancelHandle
impl UnwindSafe for CancelHandle
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