pub struct ServerConfig {Show 20 fields
pub host: String,
pub port: u16,
pub max_body_bytes: usize,
pub request_timeout_ms: u64,
pub header_read_timeout_ms: u64,
pub max_headers: usize,
pub max_path_segments: usize,
pub ws_max_frame_bytes: usize,
pub ws_max_message_bytes: usize,
pub keep_alive_ms: u64,
pub backlog: u32,
pub shutdown_timeout_ms: u64,
pub path_policy: PathPolicy,
pub h2_max_header_list_size: u32,
pub h2_max_concurrent_streams: u32,
pub ws_idle_timeout_ms: u64,
pub max_connections: usize,
pub max_tls_handshakes: usize,
pub tls_handshake_timeout_ms: u64,
pub tls: Option<TlsSection>,
}Expand description
The server configuration resolved at build time and carried by an App.
Populated from defaults, an optional Config, and the
builder’s DSL setters. Read it back from a built app with
App::config.
Fields§
§host: StringBind address host.
port: u16Bind port.
max_body_bytes: usizeMaximum accepted request body size in bytes; larger bodies get 413.
request_timeout_ms: u64Per-request timeout in milliseconds; 0 disables the timeout.
header_read_timeout_ms: u64Deadline for a client to finish sending its header block; 0 disables.
max_headers: usizeMaximum number of request headers accepted.
max_path_segments: usizeMaximum path segments before a request is rejected with 414.
ws_max_frame_bytes: usizeMaximum WebSocket frame size in bytes (ws feature).
ws_max_message_bytes: usizeMaximum reassembled WebSocket message size in bytes (ws feature).
keep_alive_ms: u64Idle keep-alive in milliseconds; 0 disables connection reuse.
Idle means no request in flight, so a slow handler is never cut off.
backlog: u32Listen backlog.
shutdown_timeout_ms: u64Graceful-shutdown grace period in milliseconds; 0 waits forever.
path_policy: PathPolicyWhat to do with a non-canonical path spelling.
h2_max_header_list_size: u32Maximum size of a received HTTP/2 header block, in bytes. The h2
counterpart of max_headers, which configures HTTP/1 only.
h2_max_concurrent_streams: u32Maximum concurrent HTTP/2 streams per connection; 0 removes the limit.
ws_idle_timeout_ms: u64WebSocket idle bound in milliseconds; 0 disables it (ws feature).
max_connections: usizeMaximum simultaneously served connections; 0 means unlimited.
max_tls_handshakes: usizeMaximum TLS handshakes in progress at once; 0 means unlimited.
tls_handshake_timeout_ms: u64TLS handshake deadline in milliseconds; 0 disables the bound.
tls: Option<TlsSection>TLS settings, or None for plaintext HTTP.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more