pub struct UncancellableToken {}Expand description
An implementation of CancellationToken which will never signal the
cancelled state
Trait Implementations§
Source§impl CancellationToken for UncancellableToken
impl CancellationToken for UncancellableToken
Source§fn error_if_cancelled(&self) -> Result<(), CancellationError>
fn error_if_cancelled(&self) -> Result<(), CancellationError>
Performs a one-time check whether the flow of execution is cancelled. Read more
Source§fn on_cancellation<'a>(
&self,
func: &'a mut CancellationFunc<'a>,
) -> CancellationGuard<'a>
fn on_cancellation<'a>( &self, func: &'a mut CancellationFunc<'a>, ) -> CancellationGuard<'a>
Registers a cancellation handler, which will be invoked when the execution flow
is cancelled.
The cancellation handler can be called from any thread which initiates the cancellation.
If the flow is already cancelled when this function is called, the cancellation
handler will be called synchronously.
The function returns a guard which can be used to unregister the cancellation handler.
After the guard is dropped, the handler is guaranteed not be called anymore.
Source§impl Debug for UncancellableToken
impl Debug for UncancellableToken
Source§impl Default for UncancellableToken
impl Default for UncancellableToken
Source§fn default() -> UncancellableToken
fn default() -> UncancellableToken
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for UncancellableToken
impl RefUnwindSafe for UncancellableToken
impl Send for UncancellableToken
impl Sync for UncancellableToken
impl Unpin for UncancellableToken
impl UnwindSafe for UncancellableToken
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