#[repr(u8)]pub enum ShutdownPhase {
Running = 0,
StopAccepting = 1,
ShutdownFlagged = 2,
GracePeriod = 3,
Cancelling = 4,
RunningHooks = 5,
Stopped = 6,
}Expand description
Current phase of the shutdown process.
Variants§
Running = 0
Server is running normally.
StopAccepting = 1
Stop accepting new connections.
ShutdownFlagged = 2
Shutdown flag set; new requests get 503.
GracePeriod = 3
Grace period for in-flight requests.
Cancelling = 4
Cancelling remaining requests.
RunningHooks = 5
Running shutdown hooks.
Stopped = 6
Server fully stopped.
Implementations§
Source§impl ShutdownPhase
impl ShutdownPhase
Sourcepub fn should_reject_connections(self) -> bool
pub fn should_reject_connections(self) -> bool
Returns true if the server should stop accepting connections.
Sourcepub fn should_reject_requests(self) -> bool
pub fn should_reject_requests(self) -> bool
Returns true if new requests should receive 503.
Sourcepub fn is_shutting_down(self) -> bool
pub fn is_shutting_down(self) -> bool
Returns true if the server is in a shutdown state.
Sourcepub fn is_stopped(self) -> bool
pub fn is_stopped(self) -> bool
Returns true if cleanup is complete.
Trait Implementations§
Source§impl Clone for ShutdownPhase
impl Clone for ShutdownPhase
Source§fn clone(&self) -> ShutdownPhase
fn clone(&self) -> ShutdownPhase
Returns a duplicate of the value. Read more
1.0.0 · 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 ShutdownPhase
impl Debug for ShutdownPhase
Source§impl From<u8> for ShutdownPhase
impl From<u8> for ShutdownPhase
Source§impl PartialEq for ShutdownPhase
impl PartialEq for ShutdownPhase
impl Copy for ShutdownPhase
impl Eq for ShutdownPhase
impl StructuralPartialEq for ShutdownPhase
Auto Trait Implementations§
impl Freeze for ShutdownPhase
impl RefUnwindSafe for ShutdownPhase
impl Send for ShutdownPhase
impl Sync for ShutdownPhase
impl Unpin for ShutdownPhase
impl UnwindSafe for ShutdownPhase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).