Struct stop_token::StopSource
source · [−]pub struct StopSource { /* private fields */ }
Expand description
StopSource
produces StopToken
and cancels all of its tokens on drop.
Example:
ⓘ
let source = StopSource::new();
let token = source.token();
schedule_some_work(token);
drop(source); // At this point, scheduled work notices that it is canceled.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more