Struct async_shutdown::DelayShutdownToken
source · pub struct DelayShutdownToken { /* private fields */ }
Expand description
Token that delays completion of a shutdown as long as it exists.
The token can be cloned and sent to different threads and tasks freely.
All clones must be dropped before the shutdown can complete.
Implementations§
source§impl DelayShutdownToken
impl DelayShutdownToken
sourcepub fn wrap_wait<F: Future>(self, future: F) -> WrapWait<F> ⓘ
pub fn wrap_wait<F: Future>(self, future: F) -> WrapWait<F> ⓘ
Wrap a future to delay shutdown completion until it completes.
This consumes the token to avoid keeping an unused token around by accident, which would delay shutdown indefinately.
If you wish to use the token multiple times, you can clone it first: token.clone().wrap_wait(...)
.
The returned future transparently completes with the value of the wrapped future. However, the shutdown will not be considered complete until the future completes or is dropped.
Trait Implementations§
source§impl Clone for DelayShutdownToken
impl Clone for DelayShutdownToken
Auto Trait Implementations§
impl RefUnwindSafe for DelayShutdownToken
impl Send for DelayShutdownToken
impl Sync for DelayShutdownToken
impl Unpin for DelayShutdownToken
impl UnwindSafe for DelayShutdownToken
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