pub struct AsyncCancellationToken { /* private fields */ }Expand description
Cooperative cancellation signal available to asynchronous function bodies.
Implementations§
Source§impl AsyncCancellationToken
impl AsyncCancellationToken
Sourcepub fn is_cancellation_requested(&self) -> bool
pub fn is_cancellation_requested(&self) -> bool
Returns whether the owning request or runtime generation was canceled.
The token is cooperative: a running task must inspect it and return on its own. Ignoring it never permits publishing into a retired generation.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncCancellationToken
impl !UnwindSafe for AsyncCancellationToken
impl Freeze for AsyncCancellationToken
impl Send for AsyncCancellationToken
impl Sync for AsyncCancellationToken
impl Unpin for AsyncCancellationToken
impl UnsafeUnpin for AsyncCancellationToken
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