Struct ffi_helpers::task::CancellationToken
[−]
[src]
pub struct CancellationToken(_);
A shareable token to let you notify other tasks they should stop what they are doing and exit early.
Methods
impl CancellationToken
[src]
pub fn new() -> CancellationToken
[src]
Create a new CancellationToken
.
pub fn cancelled(&self) -> bool
[src]
Has this token already been cancelled?
pub fn cancel(&self)
[src]
Cancel the token, notifying anyone else listening that they should halt what they are doing.
pub fn is_done(&self) -> Result<(), Cancelled>
[src]
Trait Implementations
impl Debug for CancellationToken
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for CancellationToken
[src]
fn clone(&self) -> CancellationToken
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for CancellationToken
[src]
fn default() -> CancellationToken
[src]
Returns the "default value" for a type. Read more