pub struct CancelToken(/* private fields */);Expand description
A cloneable cancellation flag. Every clone observes the same flag, so the owner of a job keeps one clone and hands others to the lanes working on it.
Cancellation is one-way: once raised it stays raised for the token’s lifetime.
Implementations§
Source§impl CancelToken
impl CancelToken
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether Self::cancel has been called on any clone.
Sourcepub fn as_flag(&self) -> &AtomicBool
pub fn as_flag(&self) -> &AtomicBool
The underlying flag, for code that takes a plain &AtomicBool (the export’s
existing dispatch helpers, the tracer’s cancellable entry points).
Trait Implementations§
Source§impl Clone for CancelToken
impl Clone for CancelToken
Source§impl Debug for CancelToken
impl Debug for CancelToken
Auto Trait Implementations§
impl Freeze for CancelToken
impl RefUnwindSafe for CancelToken
impl Send for CancelToken
impl Sync for CancelToken
impl Unpin for CancelToken
impl UnsafeUnpin for CancelToken
impl UnwindSafe for CancelToken
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