Struct async_shutdown::ShutdownSignal
source · pub struct ShutdownSignal { /* private fields */ }Expand description
A future to wait for a shutdown signal.
The future completes when the associated Shutdown triggers a shutdown.
The shutdown signal can be cloned and sent between threads freely.
Implementations§
source§impl ShutdownSignal
impl ShutdownSignal
sourcepub fn wrap_cancel<F: Future>(&self, future: F) -> WrapCancel<F> ⓘ
pub fn wrap_cancel<F: Future>(&self, future: F) -> WrapCancel<F> ⓘ
Wrap a future so that it is cancelled when a shutdown is triggered.
The returned future completes with None when a shutdown is triggered,
and with Some(x) when the wrapped future completes.
The wrapped future is dropped when the shutdown starts before the future completed. If the wrapped future completes before the shutdown signal arrives, it is not dropped.
Trait Implementations§
source§impl Clone for ShutdownSignal
impl Clone for ShutdownSignal
source§impl Drop for ShutdownSignal
impl Drop for ShutdownSignal
source§impl Future for ShutdownSignal
impl Future for ShutdownSignal
Auto Trait Implementations§
impl Freeze for ShutdownSignal
impl RefUnwindSafe for ShutdownSignal
impl Send for ShutdownSignal
impl Sync for ShutdownSignal
impl Unpin for ShutdownSignal
impl UnwindSafe for ShutdownSignal
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,
§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