pub struct ServeOptions {
pub max_concurrency: Option<usize>,
pub max_serve_errors: Option<usize>,
pub request_timeout_ms: Option<u64>,
pub max_connections_per_peer: Option<usize>,
pub max_request_body_bytes: Option<usize>,
pub drain_timeout_ms: Option<u64>,
pub max_total_connections: Option<usize>,
pub load_shed: Option<bool>,
}Expand description
Options for the HTTP serve loop.
Passed directly to serve() or serve_with_events(). These govern
per-request middleware (Tower layers), inbound connection caps, and
serve-loop lifecycle — they do not affect outgoing fetch calls.
Fields§
§max_concurrency: Option<usize>Maximum simultaneous in-flight requests. Default: 1024.
max_serve_errors: Option<usize>Consecutive accept-loop errors before the serve loop terminates. Default: 5.
request_timeout_ms: Option<u64>Per-request timeout in milliseconds. Default: 60 000.
max_connections_per_peer: Option<usize>Maximum connections from a single peer. Default: 8.
max_request_body_bytes: Option<usize>Reject request bodies larger than this many bytes. Default: 16 MiB.
drain_timeout_ms: Option<u64>Graceful shutdown drain window in milliseconds. Default: 30 000.
max_total_connections: Option<usize>Maximum total QUIC connections the server will accept. Default: unlimited.
load_shed: Option<bool>When true (the default), reject new requests immediately with 503 Service Unavailable when max_concurrency is already reached rather
than queuing them. Prevents thundering-herd on recovery.
Trait Implementations§
Source§impl Clone for ServeOptions
impl Clone for ServeOptions
Source§fn clone(&self) -> ServeOptions
fn clone(&self) -> ServeOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServeOptions
impl Debug for ServeOptions
Source§impl Default for ServeOptions
impl Default for ServeOptions
Source§fn default() -> ServeOptions
fn default() -> ServeOptions
Auto Trait Implementations§
impl Freeze for ServeOptions
impl RefUnwindSafe for ServeOptions
impl Send for ServeOptions
impl Sync for ServeOptions
impl Unpin for ServeOptions
impl UnsafeUnpin for ServeOptions
impl UnwindSafe for ServeOptions
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
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: 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>
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>
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