pub struct ShutdownHandle { /* private fields */ }Expand description
External handle for the event loop to check shutdown status.
Shares the same AtomicBool as the world’s shutdown flag.
Obtained via World::shutdown_handle.
Implementations§
Source§impl ShutdownHandle
impl ShutdownHandle
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Returns true if shutdown has been triggered.
Sourcepub fn enable_signals(&self) -> Result<()>
pub fn enable_signals(&self) -> Result<()>
Register SIGINT and SIGTERM handlers that trigger shutdown.
Unix/Linux only. Uses signal_hook::flag::register — the signal
handler simply flips the shared AtomicBool. Safe to call
multiple times (subsequent calls are no-ops at the OS level for
the same signal).
§Errors
Returns an error if the OS rejects the signal registration.
§Platform Support
Targets Linux infrastructure. Not supported on Windows.
Auto Trait Implementations§
impl Freeze for ShutdownHandle
impl RefUnwindSafe for ShutdownHandle
impl Send for ShutdownHandle
impl Sync for ShutdownHandle
impl Unpin for ShutdownHandle
impl UnsafeUnpin 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