#[non_exhaustive]pub enum ShutdownReason {
Signal(Signal),
Requested,
Forced,
Timeout,
Error,
}Expand description
Why a shutdown was initiated.
Carried by ShutdownTrigger::trigger
and surfaced to observers via ShutdownToken::reason
and to hooks via ShutdownHook::run.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Signal(Signal)
Originated from a delivered OS signal.
Requested
Programmatic shutdown request (admin endpoint, parent supervisor, fatal-error branch, etc.).
Forced
Graceful budget elapsed; remaining hooks were skipped.
Timeout
A timed operation exceeded its deadline.
Error
Shutdown driven by an internal error condition.
Implementations§
Trait Implementations§
Source§impl Clone for ShutdownReason
impl Clone for ShutdownReason
Source§fn clone(&self) -> ShutdownReason
fn clone(&self) -> ShutdownReason
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShutdownReason
impl Debug for ShutdownReason
Source§impl Display for ShutdownReason
impl Display for ShutdownReason
Source§impl PartialEq for ShutdownReason
impl PartialEq for ShutdownReason
Source§fn eq(&self, other: &ShutdownReason) -> bool
fn eq(&self, other: &ShutdownReason) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ShutdownReason
impl Eq for ShutdownReason
impl StructuralPartialEq for ShutdownReason
Auto Trait Implementations§
impl Freeze for ShutdownReason
impl RefUnwindSafe for ShutdownReason
impl Send for ShutdownReason
impl Sync for ShutdownReason
impl Unpin for ShutdownReason
impl UnsafeUnpin for ShutdownReason
impl UnwindSafe for ShutdownReason
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