pub struct Cancellation(/* private fields */);Expand description
A cancellation flag shared with whoever may cancel the run.
Cloning shares the same underlying flag: cancelling one handle cancels
every clone, including ones already handed to a Budget.
Implementations§
Source§impl Cancellation
impl Cancellation
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Requests cancellation. Idempotent: cancelling twice is the same as cancelling once.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether Cancellation::cancel has been called on this flag or any
clone of it.
Trait Implementations§
Source§impl Clone for Cancellation
impl Clone for Cancellation
Source§fn clone(&self) -> Cancellation
fn clone(&self) -> Cancellation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Cancellation
impl Debug for Cancellation
Source§impl Default for Cancellation
impl Default for Cancellation
Source§fn default() -> Cancellation
fn default() -> Cancellation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Cancellation
impl RefUnwindSafe for Cancellation
impl Send for Cancellation
impl Sync for Cancellation
impl Unpin for Cancellation
impl UnsafeUnpin for Cancellation
impl UnwindSafe for Cancellation
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