pub struct ServiceConfigBuilder { /* private fields */ }
Expand description
A builder for creating a ServiceConfig
Implementations§
Source§impl ServiceConfigBuilder
impl ServiceConfigBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new, default, ServiceConfigBuilder
It uses the following default values:
KeepAlive::default
for the connection keep-alive setting- 5 seconds for the client request timeout
- 0 seconds for the client shutdown timeout
- secure value of
false
None
for the local address setting- Allow for half closed HTTP/1 connections
Sourcepub fn local_addr(self, local_addr: Option<SocketAddr>) -> Self
pub fn local_addr(self, local_addr: Option<SocketAddr>) -> Self
Sets the local address for this configuration
Sourcepub fn keep_alive(self, keep_alive: KeepAlive) -> Self
pub fn keep_alive(self, keep_alive: KeepAlive) -> Self
Sets connection keep-alive setting
Sourcepub fn client_request_timeout(self, timeout: Duration) -> Self
pub fn client_request_timeout(self, timeout: Duration) -> Self
Sets the timeout for the client to finish sending the head of its first request
Sourcepub fn client_disconnect_timeout(self, timeout: Duration) -> Self
pub fn client_disconnect_timeout(self, timeout: Duration) -> Self
Sets the timeout for cleanly disconnecting from the client after connection shutdown has started
Sourcepub fn h1_allow_half_closed(self, allow: bool) -> Self
pub fn h1_allow_half_closed(self, allow: bool) -> Self
Sets whether HTTP/1 connections should support half-closures.
Clients can choose to shutdown their writer-side of the connection after completing their
request and while waiting for the server response. Setting this to false
will cause the
server to abort the connection handling as soon as it detects an EOF from the client
Sourcepub fn build(self) -> ServiceConfig
pub fn build(self) -> ServiceConfig
Builds a ServiceConfig
from this ServiceConfigBuilder
instance