pub struct CancellationToken { /* private fields */ }Expand description
Read-only cancellation view carried by a node execution context.
Implementations§
Source§impl CancellationToken
impl CancellationToken
Sourcepub fn cancelled(request: CancellationRequest) -> Self
pub fn cancelled(request: CancellationRequest) -> Self
Create a token that already has cancellation requested.
Sourcepub fn request(&self) -> Option<CancellationRequest>
pub fn request(&self) -> Option<CancellationRequest>
Return the current cancellation request, if any.
Sourcepub fn state(&self) -> CancellationState
pub fn state(&self) -> CancellationState
Return the current cancellation state.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Return whether cancellation has been requested.
Trait Implementations§
Source§impl Clone for CancellationToken
impl Clone for CancellationToken
Source§fn clone(&self) -> CancellationToken
fn clone(&self) -> CancellationToken
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 CancellationToken
impl Debug for CancellationToken
Source§impl Default for CancellationToken
impl Default for CancellationToken
Source§impl PartialEq for CancellationToken
impl PartialEq for CancellationToken
impl Eq for CancellationToken
Auto Trait Implementations§
impl Freeze for CancellationToken
impl RefUnwindSafe for CancellationToken
impl Send for CancellationToken
impl Sync for CancellationToken
impl Unpin for CancellationToken
impl UnsafeUnpin for CancellationToken
impl UnwindSafe for CancellationToken
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).