pub struct CancellationToken { /* private fields */ }Expand description
This type signals a cancellation event.
It is Sync and Send so you can share it between threads freely.
It also implements Eq, Ord and Hash, with some arbitrary ordering,
so that you can use it as a cheap identifier for your interruptible actions.
All clones of the same token will compare equal.
Implementations§
Source§impl CancellationToken
impl CancellationToken
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 · 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§fn default() -> CancellationToken
fn default() -> CancellationToken
Returns the “default value” for a type. Read more
Source§impl Hash for CancellationToken
impl Hash for CancellationToken
Source§impl Ord for CancellationToken
impl Ord for CancellationToken
Source§impl PartialEq for CancellationToken
impl PartialEq for CancellationToken
Source§impl PartialOrd for CancellationToken
impl PartialOrd 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 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