pub struct CancellationHandle { /* private fields */ }Expand description
Runtime-owned handle that can request cancellation for shared contexts.
Implementations§
Source§impl CancellationHandle
impl CancellationHandle
Sourcepub fn token(&self) -> CancellationToken
pub fn token(&self) -> CancellationToken
Return a read-only token suitable for attaching to a NodeContext.
Sourcepub fn cancel(&self, request: CancellationRequest) -> bool
pub fn cancel(&self, request: CancellationRequest) -> bool
Request cancellation for every context sharing this handle’s token.
Returns true when this call recorded the first cancellation request.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Return whether cancellation has been requested.
Sourcepub fn request(&self) -> Option<CancellationRequest>
pub fn request(&self) -> Option<CancellationRequest>
Return the current cancellation request, if any.
Trait Implementations§
Source§impl Clone for CancellationHandle
impl Clone for CancellationHandle
Source§fn clone(&self) -> CancellationHandle
fn clone(&self) -> CancellationHandle
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 CancellationHandle
impl Debug for CancellationHandle
Source§impl Default for CancellationHandle
impl Default for CancellationHandle
Source§impl PartialEq for CancellationHandle
impl PartialEq for CancellationHandle
Source§fn eq(&self, other: &CancellationHandle) -> bool
fn eq(&self, other: &CancellationHandle) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CancellationHandle
impl StructuralPartialEq for CancellationHandle
Auto Trait Implementations§
impl Freeze for CancellationHandle
impl RefUnwindSafe for CancellationHandle
impl Send for CancellationHandle
impl Sync for CancellationHandle
impl Unpin for CancellationHandle
impl UnsafeUnpin for CancellationHandle
impl UnwindSafe for CancellationHandle
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).