pub struct Http2Options { /* private fields */ }h2 only.Expand description
HTTP/2 server configuration.
Build one with Http2Options::default and override individual fields
with the builder methods, then hand it to Http2::new.
Unlike the framing/header limits below, the connection window settings
(initial_stream_window_size
and initial_connection_window_size)
are advisory: a client may shrink them with its own SETTINGS, and the
server honours the smaller value.
Implementations§
Source§impl Http2Options
impl Http2Options
Sourcepub fn handshake_timeout(self, handshake_timeout: Option<Duration>) -> Self
pub fn handshake_timeout(self, handshake_timeout: Option<Duration>) -> Self
Sets the maximum time to wait for a client to send the HTTP/2 preface before aborting the connection.
Sourcepub fn send_continue_response(self, send_continue_response: bool) -> Self
pub fn send_continue_response(self, send_continue_response: bool) -> Self
Sends 100 Continue responses automatically when a request has a body.
Defaults to true.
Sourcepub fn send_date_header(self, send_date_header: bool) -> Self
pub fn send_date_header(self, send_date_header: bool) -> Self
Inserts a Date header into responses that lack one.
Defaults to true.
Sourcepub fn max_concurrent_streams(self, max_concurrent_streams: u32) -> Self
pub fn max_concurrent_streams(self, max_concurrent_streams: u32) -> Self
Sets the maximum number of concurrent streams allowed on a connection.
Defaults to 200.
Sourcepub fn initial_stream_window_size(self, initial_stream_window_size: u32) -> Self
pub fn initial_stream_window_size(self, initial_stream_window_size: u32) -> Self
Sets the initial per-stream flow-control window size advertised to the
client. Defaults to 1_048_576.
Sourcepub fn initial_connection_window_size(
self,
initial_connection_window_size: u32,
) -> Self
pub fn initial_connection_window_size( self, initial_connection_window_size: u32, ) -> Self
Sets the initial connection-level flow-control window size.
Defaults to 1_048_576.
Sourcepub fn max_frame_size(self, max_frame_size: u32) -> Self
pub fn max_frame_size(self, max_frame_size: u32) -> Self
Sets the maximum frame size the server will send or receive.
Defaults to the RFC 9113 default (16_384); must not exceed
2^24 - 1.
Sourcepub fn max_header_list_size(self, max_header_list_size: u32) -> Self
pub fn max_header_list_size(self, max_header_list_size: u32) -> Self
Sets the maximum size of an uncompressed header list the server will
accept. Defaults to 16_384.
Sourcepub fn enable_connect_protocol(self, enable: bool) -> Self
pub fn enable_connect_protocol(self, enable: bool) -> Self
Sets whether to enable the Extended CONNECT protocol, allowing for
example for tunneling WebSockets over HTTP/2. Defaults to false.
Sourcepub fn idle_timeout(self, idle_timeout: Option<Duration>) -> Self
pub fn idle_timeout(self, idle_timeout: Option<Duration>) -> Self
Sets the idle timeout: a connection that receives no frame from the
peer for this long is closed gracefully with a GOAWAY (RFC 9113
Section 10.5). Defaults to None (no idle timeout).
Trait Implementations§
Source§impl Clone for Http2Options
impl Clone for Http2Options
Source§fn clone(&self) -> Http2Options
fn clone(&self) -> Http2Options
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more