pub struct Config { /* private fields */ }
Implementations§
Source§impl Config
impl Config
Sourcepub fn initial_stream_window_size(self, sz: impl Into<Option<u32>>) -> Self
pub fn initial_stream_window_size(self, sz: impl Into<Option<u32>>) -> Self
Sets the SETTINGS_INITIAL_WINDOW_SIZE
option for HTTP2
stream-level flow control.
Default is 65,535
Sourcepub fn initial_connection_window_size(self, sz: impl Into<Option<u32>>) -> Self
pub fn initial_connection_window_size(self, sz: impl Into<Option<u32>>) -> Self
Sets the max connection-level flow control for HTTP2
Default is 65,535
Sourcepub fn max_concurrent_streams(self, max: impl Into<Option<u32>>) -> Self
pub fn max_concurrent_streams(self, max: impl Into<Option<u32>>) -> Self
Sets the SETTINGS_MAX_CONCURRENT_STREAMS
option for HTTP2
connections.
Default is no limit (None
).
Sourcepub fn max_connection_age(self, max_connection_age: Duration) -> Self
pub fn max_connection_age(self, max_connection_age: Duration) -> Self
Sets the maximum time option in milliseconds that a connection may exist
Default is no limit (None
).
Sourcepub fn http2_keepalive_interval(
self,
http2_keepalive_interval: Option<Duration>,
) -> Self
pub fn http2_keepalive_interval( self, http2_keepalive_interval: Option<Duration>, ) -> Self
Set whether HTTP2 Ping frames are enabled on accepted connections.
If None
is specified, HTTP2 keepalive is disabled, otherwise the duration
specified will be the time interval between HTTP2 Ping frames.
The timeout for receiving an acknowledgement of the keepalive ping
can be set with Config::http2_keepalive_timeout
.
Default is no HTTP2 keepalive (None
)
Sourcepub fn http2_keepalive_timeout(
self,
http2_keepalive_timeout: Option<Duration>,
) -> Self
pub fn http2_keepalive_timeout( self, http2_keepalive_timeout: Option<Duration>, ) -> Self
Sets a timeout for receiving an acknowledgement of the keepalive ping.
If the ping is not acknowledged within the timeout, the connection will be closed. Does nothing if http2_keep_alive_interval is disabled.
Default is 20 seconds.
Sourcepub fn http2_adaptive_window(self, enabled: Option<bool>) -> Self
pub fn http2_adaptive_window(self, enabled: Option<bool>) -> Self
Sets whether to use an adaptive flow control. Defaults to false. Enabling this will override the limits set in http2_initial_stream_window_size and http2_initial_connection_window_size.
Sourcepub fn http2_max_pending_accept_reset_streams(self, max: Option<usize>) -> Self
pub fn http2_max_pending_accept_reset_streams(self, max: Option<usize>) -> Self
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to whatever the default in h2 is. As of v0.3.17, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
Sourcepub fn tcp_keepalive(self, tcp_keepalive: Option<Duration>) -> Self
pub fn tcp_keepalive(self, tcp_keepalive: Option<Duration>) -> Self
Set whether TCP keepalive messages are enabled on accepted connections.
If None
is specified, keepalive is disabled, otherwise the duration
specified will be the time to remain idle before sending TCP keepalive
probes.
Default is no keepalive (None
)
Sourcepub fn tcp_nodelay(self, enabled: bool) -> Self
pub fn tcp_nodelay(self, enabled: bool) -> Self
Set the value of TCP_NODELAY
option for accepted connections. Enabled by default.
Sourcepub fn http2_max_header_list_size(self, max: impl Into<Option<u32>>) -> Self
pub fn http2_max_header_list_size(self, max: impl Into<Option<u32>>) -> Self
Sets the max size of received header frames.
This will default to whatever the default in hyper is. As of v1.4.1, it is 16 KiB.
Sourcepub fn max_frame_size(self, frame_size: impl Into<Option<u32>>) -> Self
pub fn max_frame_size(self, frame_size: impl Into<Option<u32>>) -> Self
Sets the maximum frame size to use for HTTP2.
Passing None
will do nothing.
If not set, will default from underlying transport.
Sourcepub fn accept_http1(self, accept_http1: bool) -> Self
pub fn accept_http1(self, accept_http1: bool) -> Self
Allow this accepting http1 requests.
Default is true
.
Sourcepub fn allow_insecure(self, allow_insecure: bool) -> Self
pub fn allow_insecure(self, allow_insecure: bool) -> Self
Allow accepting insecure connections when a tls_config is provided.
This will allow clients to connect both using TLS as well as without TLS on the same network interface.
Default is false
.
NOTE: This presently will only work for tokio::net::TcpStream
IO connections