pub struct ClientBuilder(/* private fields */);Expand description
A builder for Client
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn new() -> Self
Sourcepub fn from_hyper_client_builder(inner: HyperClientBuilder) -> Self
pub fn from_hyper_client_builder(inner: HyperClientBuilder) -> Self
Create a builder with a configured instance of HyperClientBuilder.
Sourcepub fn pool_max_idle_per_host(&mut self, max_idle: usize) -> &mut Self
pub fn pool_max_idle_per_host(&mut self, max_idle: usize) -> &mut Self
Sets the maximum idle connection per host allowed in the pool.
Default is usize::MAX (no limit).
Sourcepub fn pool_idle_timeout(&mut self, val: Option<Duration>) -> &mut Self
pub fn pool_idle_timeout(&mut self, val: Option<Duration>) -> &mut Self
Set an optional timeout for idle sockets being kept-alive.
Pass None to disable timeout.
Default is 90 seconds.
Sourcepub fn http2_only(&mut self, val: bool) -> &mut Self
pub fn http2_only(&mut self, val: bool) -> &mut Self
Set whether the connection must use HTTP/2.
Note that setting this to true prevents HTTP/1 from being allowed.
Default is false.
Sourcepub fn build<C: NetworkConnector>(&self, connector: C) -> Client
pub fn build<C: NetworkConnector>(&self, connector: C) -> Client
Combine the configuration of this builder with a connector to create a
Client.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more