pub struct ShutdownSignal { /* private fields */ }Expand description
Future that resolves when shutdown is triggered.
Registers (and updates) a waker on every poll so that
ShutdownHandle::trigger() (or a signal handler) can wake the
awaiting task directly. The waker is overwritten on each poll to
handle the case where the future is re-polled from a different
task context.
Single waiter only. Only one task may await ShutdownSignal at a
time. If a second task polls while a waker is already registered, the
waker is replaced (not duplicated). For multi-waiter shutdown, use
CancellationToken instead.
Holds a raw pointer to the AtomicBool flag, valid for the lifetime
of the Runtime (which outlives block_on which outlives all tasks).
Trait Implementations§
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 UnsafeUnpin 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,
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