pub struct ShutdownHook { /* private fields */ }
Expand description
A named future that will be invoked after all the tasks are stopped. The future is expected to perform a cleanup or a shutdown of the service.
All the shutdown hooks will be executed sequentially, so they may assume that no other tasks are running at the moment of execution on the same node. However, an unique access to the database is not guaranteed, since the node may run in a distributed mode, so this should not be used for potentially destructive actions.
Implementations§
Trait Implementations§
Source§impl Debug for ShutdownHook
impl Debug for ShutdownHook
Source§impl IntoContext for ShutdownHook
impl IntoContext for ShutdownHook
fn into_context( self, context: &mut ServiceContext<'_>, ) -> Result<(), WiringError>
Auto Trait Implementations§
impl Freeze for ShutdownHook
impl !RefUnwindSafe for ShutdownHook
impl Send for ShutdownHook
impl !Sync for ShutdownHook
impl Unpin for ShutdownHook
impl !UnwindSafe for ShutdownHook
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