Struct async_shutdown::ShutdownSignal [−][src]
pub struct ShutdownSignal { /* fields omitted */ }
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
pub fn wrap_cancel<F: Future>(&self, future: F) -> WrapCancel<F>ⓘNotable traits for WrapCancel<F>impl<F: Future> Future for WrapCancel<F> type Output = Option<F::Output>;
pub fn wrap_cancel<F: Future>(&self, future: F) -> WrapCancel<F>ⓘNotable traits for WrapCancel<F>impl<F: Future> Future for WrapCancel<F> type Output = Option<F::Output>;
impl<F: Future> Future for WrapCancel<F> type Output = Option<F::Output>;
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
fn clone(&self) -> ShutdownSignalⓘNotable traits for ShutdownSignalimpl Future for ShutdownSignal type Output = ();
fn clone(&self) -> ShutdownSignalⓘNotable traits for ShutdownSignalimpl Future for ShutdownSignal type Output = ();
impl Future for ShutdownSignal type Output = ();
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ShutdownSignal
impl Send for ShutdownSignal
impl Sync for ShutdownSignal
impl Unpin for ShutdownSignal
impl UnwindSafe for ShutdownSignal
Blanket Implementations
Mutably borrows from an owned value. Read more
into_future
)The output that the future will produce on completion.
type Future = F
type Future = F
into_future
)Which kind of future are we turning this into?
into_future
)Creates a future from a value.