#[non_exhaustive]pub enum CancellationCause {
Requested,
Timeout,
}Expand description
Why a cooperative cancellation request was delivered to this run.
Read from the optional top-level cause of the portable cancellation
context. Requested is an ordinary cancellation request (cause absent or
cancellation). Timeout is a deadline-triggered cleanup request: the run
passed its work deadline and has until the request’s cleanup deadline to
clean up, and it still ends timed out. The cause is never inherited: a
descendant cancelled under the request, scoped or not, is an ordinary
cancellation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Requested
An ordinary cooperative cancellation request.
Timeout
A timeout-cleanup request after the run’s work deadline passed.
Implementations§
Source§impl CancellationCause
impl CancellationCause
Sourcepub fn is_timeout(self) -> bool
pub fn is_timeout(self) -> bool
Whether this is a timeout-cleanup request.
Trait Implementations§
Source§impl Clone for CancellationCause
impl Clone for CancellationCause
Source§fn clone(&self) -> CancellationCause
fn clone(&self) -> CancellationCause
Returns a copy 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 Debug for CancellationCause
impl Debug for CancellationCause
Source§impl Hash for CancellationCause
impl Hash for CancellationCause
Source§impl PartialEq for CancellationCause
impl PartialEq for CancellationCause
impl Copy for CancellationCause
impl Eq for CancellationCause
impl StructuralPartialEq for CancellationCause
Auto Trait Implementations§
impl Freeze for CancellationCause
impl RefUnwindSafe for CancellationCause
impl Send for CancellationCause
impl Sync for CancellationCause
impl Unpin for CancellationCause
impl UnwindSafe for CancellationCause
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