Struct tokio_shutdown::Shutdown
source · pub struct Shutdown { /* private fields */ }
Expand description
The global shutdown handler for an application. It can be cloned cheaply wherever needed.
New handles can be created with the handle
function, which creates futures
that will complete once a shutdown signal is received.
Implementations§
source§impl Shutdown
impl Shutdown
sourcepub fn new() -> Result<Shutdown, AlreadyCreatedError>
pub fn new() -> Result<Shutdown, AlreadyCreatedError>
Create a new shutdown handle. This can only be called once per application instance.
Signal handles can only be registered once for the duration of the entire process and creating another shutdown handler would break the previous one without notice.
Errors
If this function is called more than once during the lifetime of a process, an error will be returned.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Shutdown
impl Send for Shutdown
impl Sync for Shutdown
impl Unpin for Shutdown
impl !UnwindSafe for Shutdown
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