Skip to main content

Token

Trait Token 

Source
pub trait Token: Send + Sync {
    // Required method
    fn check(&self) -> Result<(), Cancelled>;
}
Expand description

A trait for an arbitrary cancellation token. Use (), if you don’t have any cancellation token.

Required Methods§

Source

fn check(&self) -> Result<(), Cancelled>

Returns Cancelled, if the operation has been cancelled.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Token for ()

Implementors§