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§
Sourcefn wait(&self) -> Pin<Box<dyn EventFuture>>
fn wait(&self) -> Pin<Box<dyn EventFuture>>
Get a future to wait for cancellation.
Sourcefn is_cancelled(&self) -> bool
fn is_cancelled(&self) -> bool
Is the token cancelled
Sourcefn clone_box(&self) -> Box<dyn CancelToken>
fn clone_box(&self) -> Box<dyn CancelToken>
Clone the cancel token. Because the dyn requirement, CancelToken cannot be cloned directly.
Implementors§
impl CancelToken for SimpleCancelToken
Integrate with mssf trait system.