pub struct WrapCancel<T: Clone, F> { /* private fields */ }
Expand description
Wrapped future that is automatically cancelled when a shutdown is triggered.
If the wrapped future completes before the shutdown is triggered,
the output of the original future is yielded as Ok(value)
.
If the shutdown is triggered before the wrapped future completes,
the original future is dropped and the shutdown reason is yielded as Err(shutdown_reason)
.
Trait Implementations§
Auto Trait Implementations§
impl<T, F> Freeze for WrapCancel<T, F>
impl<T, F> RefUnwindSafe for WrapCancel<T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for WrapCancel<T, F>
impl<T, F> Sync for WrapCancel<T, F>
impl<T, F> Unpin for WrapCancel<T, F>
impl<T, F> UnwindSafe for WrapCancel<T, F>where
F: UnwindSafe,
T: UnwindSafe,
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
Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more