pub struct CancelToken { /* private fields */ }Expand description
Cooperative cancellation shared by a job and everything it starts.
Implementations§
Source§impl CancelToken
impl CancelToken
Sourcepub fn paced(&self, slice: Duration) -> CancelToken
pub fn paced(&self, slice: Duration) -> CancelToken
Returns a token that shares cancellation and rests after each sustained
slice of work. Clones of the returned token share the pacing state.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns whether this token has been cancelled. Paced tokens may rest before reading the shared flag.
Trait Implementations§
Source§impl Clone for CancelToken
impl Clone for CancelToken
Source§impl Debug for CancelToken
impl Debug for CancelToken
Auto Trait Implementations§
impl !RefUnwindSafe for CancelToken
impl !UnwindSafe for CancelToken
impl Freeze for CancelToken
impl Send for CancelToken
impl Sync for CancelToken
impl Unpin for CancelToken
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more