pub struct RequestCancellation(/* private fields */);Expand description
Caller-controlled, one-shot cancellation handle shared by its clones.
The default is a fresh, uncancelled handle. Cancellation stops waiting for the request and prevents queued work from starting, but cannot interrupt a synchronous kernel already running; its resources remain held until it exits.
Implementations§
Source§impl RequestCancellation
impl RequestCancellation
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Permanently cancel this handle and every clone. Repeated calls are harmless.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Return whether this handle or any clone has been cancelled.
Trait Implementations§
Source§impl Clone for RequestCancellation
impl Clone for RequestCancellation
Source§impl Debug for RequestCancellation
impl Debug for RequestCancellation
Auto Trait Implementations§
impl !RefUnwindSafe for RequestCancellation
impl !UnwindSafe for RequestCancellation
impl Freeze for RequestCancellation
impl Send for RequestCancellation
impl Sync for RequestCancellation
impl Unpin for RequestCancellation
impl UnsafeUnpin for RequestCancellation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more