pub struct ShutdownHandle(/* private fields */);
Expand description
Notifies a service about an upcoming shutdown.
This handle is returned by Controller::shutdown_handle
.
Implementations§
source§impl ShutdownHandle
impl ShutdownHandle
sourcepub async fn notified(&mut self) -> Shutdown
pub async fn notified(&mut self) -> Shutdown
Wait for a shutdown.
This receives all shutdown signals since the Controller
has been started, even before
this shutdown handle has been obtained.
§Cancel safety
This method is cancellation safe and can be used in select!
.
sourcepub async fn finished(self)
pub async fn finished(self)
Wait for the shutdown and timeout to complete.
This waits for the first shutdown signal and then conditionally waits for the shutdown timeout. If the shutdown timeout is interrupted by another signal, this function resolves immediately.
§Cancel safety
This method is not cancel safe.
Auto Trait Implementations§
impl Freeze for ShutdownHandle
impl RefUnwindSafe for ShutdownHandle
impl Send for ShutdownHandle
impl Sync for ShutdownHandle
impl Unpin for ShutdownHandle
impl UnwindSafe for ShutdownHandle
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