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_file_line(&self, file_line_str: &'static str)
pub fn set_location_file_line(&self, file_line_str: &'static str)
Store a file line location in the run_token The string must be on the form “file:line\0”
You probably want to call the [set_location] macro instead
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