pub struct ClientBuilder(/* private fields */);
Expand description
Manages http client network connectivity.
The ClientBuilder
type uses a builder-like combinator pattern for service
construction that finishes by calling the .finish()
method.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn timeout<T: Into<Millis>>(self, timeout: T) -> Self
pub fn timeout<T: Into<Millis>>(self, timeout: T) -> Self
Connection timeout.
i.e. max time to connect to remote host including dns name resolution. Set to 1 second by default.
Sourcepub fn max_streams(self, limit: u32) -> Self
pub fn max_streams(self, limit: u32) -> Self
Set total number of simultaneous streams per connection.
If limit is 0, the connector uses “MAX_CONCURRENT_STREAMS” config from connection settings. The default limit size is 100.
Sourcepub fn skip_unknown_streams(self) -> Self
pub fn skip_unknown_streams(self) -> Self
Do not return error for frames for unknown streams.
This includes pending resets, data and window update frames.
Sourcepub fn lifetime(self, dur: Seconds) -> Self
pub fn lifetime(self, dur: Seconds) -> Self
Set max lifetime period for connection.
Connection lifetime is max lifetime of any opened connection until it is closed regardless of keep-alive period.
Default lifetime period is not set.
Sourcepub fn minconn(self, num: usize) -> Self
pub fn minconn(self, num: usize) -> Self
Sets the minimum concurrent connections.
By default min connections is set to a 1.
Sourcepub fn maxconn(self, num: usize) -> Self
pub fn maxconn(self, num: usize) -> Self
Sets the maximum concurrent connections.
By default max connections is set to a 16.
Sourcepub fn disconnect_timeout<T: Into<Millis>>(self, timeout: T) -> Self
pub fn disconnect_timeout<T: Into<Millis>>(self, timeout: T) -> Self
Set client connection disconnect timeout.
Defines a timeout for disconnect connection. Disconnecting connection involes closing all active streams. If a disconnect procedure does not complete within this time, the socket get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 15 seconds.