Struct async_shutdown::DelayShutdownToken [−][src]
pub struct DelayShutdownToken { /* fields omitted */ }
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
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
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
Mutably borrows from an owned value. Read more