Struct ntex_h2::client::ClientBuilder
source · 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 memory_pool(self, id: PoolId) -> Self
pub fn memory_pool(self, id: PoolId) -> Self
Set memory pool.
Use specified memory pool for memory allocations. By default P5 memory pool is used.
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 limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> 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 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 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 server connection disconnect timeout.
Defines a timeout for disconnect connection. 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 3 seconds.
sourcepub fn configure<O, R>(self, f: O) -> Selfwhere
O: FnOnce(&Config) -> R,
pub fn configure<O, R>(self, f: O) -> Selfwhere O: FnOnce(&Config) -> R,
Configure http2 connection settings