Trait HyperClientBuilder

Source
pub trait HyperClientBuilder {
    type Connector: Connect + Clone + Send + Sync + 'static;

    // Required methods
    fn with_timeout(self, timeout: Duration) -> Self;
    fn build_hyper_client(self) -> Result<HttpClient<Self::Connector>, Error>;
}
Expand description

A trait implemented for any hyper_util::client::legacy::Client as well as the DefaultHyperClient.

Required Associated Types§

Source

type Connector: Connect + Clone + Send + Sync + 'static

The hyper connector that the resulting hyper client will use.

Required Methods§

Source

fn with_timeout(self, timeout: Duration) -> Self

Sets duration after which a request times out

Source

fn build_hyper_client(self) -> Result<HttpClient<Self::Connector>, Error>

Create a hyper::Client

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl HyperClientBuilder for DefaultHyperClientBuilder

Available on crate features hyper-rustls or hyper-tls only.
Source§

impl<C> HyperClientBuilder for CustomHyperClientBuilder<C>
where C: Connect + Clone + Send + Sync + 'static,

Source§

impl<C> HyperClientBuilder for HttpClient<C>
where C: Connect + Clone + Send + Sync + 'static,