pub struct ShutdownDelegate(/* private fields */);Expand description
Permits to ask for shutdown, without counting as a task that needs to be awaited.
Implementations§
Source§impl ShutdownDelegate
impl ShutdownDelegate
Sourcepub fn ask_shutdown(&self)
pub fn ask_shutdown(&self)
Ask for all tasks to quit
Sourcepub fn handle_quit_signals(self) -> Result<(), String>
pub fn handle_quit_signals(self) -> Result<(), String>
Ensure Self::ask_shutdown is called whenever we receive SIGHUP,
SIGTERM or SIGINT. Spawns a task that consumes self.
Auto Trait Implementations§
impl Freeze for ShutdownDelegate
impl RefUnwindSafe for ShutdownDelegate
impl Send for ShutdownDelegate
impl Sync for ShutdownDelegate
impl Unpin for ShutdownDelegate
impl UnwindSafe for ShutdownDelegate
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