pub struct RunToken(/* private fields */);Expand description
Similar to a [tokio_util::sync::CancellationToken],
the RunToken encapsulates the possibility of canceling an async command.
However it also allows pausing and resuming the async command,
and it is possible to wait in both a blocking fashion and an asynchronous fashion.
Implementations§
Source§impl RunToken
 
impl RunToken
Sourcepub fn is_cancelled(&self) -> bool
 
pub fn is_cancelled(&self) -> bool
Return true iff we are canceled
Sourcepub fn cancelled(&self) -> WaitForCancellationFuture<'_> ⓘ
 
pub fn cancelled(&self) -> WaitForCancellationFuture<'_> ⓘ
Suspend the async coroutine until cancel() is called
Sourcepub fn set_location(&self, file: &'static str, line: u32)
 
pub fn set_location(&self, file: &'static str, line: u32)
Store a file line location in the run_token
pub fn location(&self) -> Option<(&'static str, u32)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RunToken
impl RefUnwindSafe for RunToken
impl Send for RunToken
impl Sync for RunToken
impl Unpin for RunToken
impl UnwindSafe for RunToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more