pub struct CancelSignal { /* private fields */ }
Expand description
An awaitable cancel signal triggered by a Canceler
.
Implementations§
Source§impl CancelSignal
impl CancelSignal
Sourcepub async fn guard<F>(&self, future: F) -> Result<F::Output, Canceled>where
F: Future,
pub async fn guard<F>(&self, future: F) -> Result<F::Output, Canceled>where
F: Future,
Waits for the given future until the cancel signal is triggered.
If the signal is triggered, this function drops the future and returns a
Canceled
error.
Sourcepub fn is_triggered(&self) -> bool
pub fn is_triggered(&self) -> bool
Returns true
if the cancel signal has been triggered.
Trait Implementations§
Source§impl Clone for CancelSignal
impl Clone for CancelSignal
Source§impl Default for CancelSignal
impl Default for CancelSignal
Source§fn default() -> CancelSignal
fn default() -> CancelSignal
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CancelSignal
impl RefUnwindSafe for CancelSignal
impl Send for CancelSignal
impl Sync for CancelSignal
impl Unpin for CancelSignal
impl UnwindSafe for CancelSignal
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