pub struct ClientBuilder<A, T> { /* 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<A> ClientBuilder<A, Connector<A>>
impl<A> ClientBuilder<A, Connector<A>>
pub fn with_default<U>(addr: U) -> Self
Source§impl<A, T> ClientBuilder<A, T>
impl<A, T> ClientBuilder<A, T>
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 connector<U, F>(self, connector: F) -> ClientBuilder<A, U>where
F: IntoServiceFactory<U, Connect<A>, SharedCfg>,
U: ServiceFactory<Connect<A>, SharedCfg, Error = ConnectError> + 'static,
IoBoxed: From<U::Response>,
pub fn connector<U, F>(self, connector: F) -> ClientBuilder<A, U>where
F: IntoServiceFactory<U, Connect<A>, SharedCfg>,
U: ServiceFactory<Connect<A>, SharedCfg, Error = ConnectError> + 'static,
IoBoxed: From<U::Response>,
Use custom connector