CancelToken

Trait CancelToken 

Source
pub trait CancelToken:
    Send
    + Sync
    + 'static {
    // Required methods
    fn wait(&self) -> Pin<Box<dyn EventFuture>>;
    fn is_cancelled(&self) -> bool;
    fn cancel(&self);
    fn clone_box(&self) -> Box<dyn CancelToken>;
}

Required Methods§

Source

fn wait(&self) -> Pin<Box<dyn EventFuture>>

Get a future to wait for cancellation.

Source

fn is_cancelled(&self) -> bool

Is the token cancelled

Source

fn cancel(&self)

Cancel the token.

Source

fn clone_box(&self) -> Box<dyn CancelToken>

Clone the cancel token. Because the dyn requirement, CancelToken cannot be cloned directly.

Implementors§

Source§

impl CancelToken for SimpleCancelToken

Integrate with mssf trait system.