pub struct Cancellable { /* private fields */ }Expand description
A cancellable handle that can be used to cancel a spawned future
This struct provides two main functionalities:
cancel()- Explicitly cancels the associated futureis_cancelled()- Checks if the future has been cancelled
The cancellation is cooperative - the future must explicitly check the cancellation status during execution
Implementations§
Source§impl Cancellable
impl Cancellable
pub fn cancel(&self)
pub fn is_cancelled(&self) -> bool
Trait Implementations§
Source§impl Clone for Cancellable
impl Clone for Cancellable
Source§fn clone(&self) -> Cancellable
fn clone(&self) -> Cancellable
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 moreSource§impl Default for Cancellable
impl Default for Cancellable
Source§fn default() -> Cancellable
fn default() -> Cancellable
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Cancellable
impl !RefUnwindSafe for Cancellable
impl !Send for Cancellable
impl !Sync for Cancellable
impl Unpin for Cancellable
impl !UnwindSafe for Cancellable
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