pub struct ShutdownConfig {
pub grace: u64,
pub stream_grace: u64,
pub readiness_delay: Option<u64>,
}Expand description
Graceful-shutdown timing ([shutdown] section).
On SIGTERM/SIGINT the server stops accepting, lets in-flight
requests finish, and only then exits. These bound how long it waits.
Fields§
§grace: u64Seconds to let ordinary in-flight requests finish.
stream_grace: u64Extra seconds granted to streaming and SSE bodies, which can
legitimately outlive a normal request. They are cut at
grace + stream_grace.
readiness_delay: Option<u64>Seconds the main listener keeps serving after the signal, with
readiness already answering 503, so a balancer probing that port
sees “draining” and moves traffic before the port closes. Unset:
5 when the probes share the main listener, else 0 (a separate
[health] bind stays up through the drain, and dev mode stops at
once).
Implementations§
Trait Implementations§
Source§impl Clone for ShutdownConfig
impl Clone for ShutdownConfig
Source§impl Debug for ShutdownConfig
impl Debug for ShutdownConfig
Source§impl Default for ShutdownConfig
impl Default for ShutdownConfig
Source§impl<'de> Deserialize<'de> for ShutdownConfigwhere
ShutdownConfig: Default,
impl<'de> Deserialize<'de> for ShutdownConfigwhere
ShutdownConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ShutdownConfig
impl RefUnwindSafe for ShutdownConfig
impl Send for ShutdownConfig
impl Sync for ShutdownConfig
impl Unpin for ShutdownConfig
impl UnsafeUnpin for ShutdownConfig
impl UnwindSafe for ShutdownConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more