Struct hyper::client::pool::Pool
[−]
[src]
pub struct Pool<C: NetworkConnector> { /* fields omitted */ }
The NetworkConnector
that behaves as a connection pool used by hyper's Client
.
Methods
impl Pool<DefaultConnector>
[src]
impl<C: NetworkConnector> Pool<C>
[src]
pub fn with_connector(config: Config, connector: C) -> Pool<C>
[src]
Creates a Pool
with a specified NetworkConnector
.
pub fn set_idle_timeout(&mut self, timeout: Option<Duration>)
[src]
Set a duration for how long an idle connection is still valid.
pub fn set_stale_check<F>(&mut self, callback: F) where
F: Fn(StaleCheck<C::Stream>) -> Stale + Send + Sync + 'static,
[src]
F: Fn(StaleCheck<C::Stream>) -> Stale + Send + Sync + 'static,
pub fn clear_idle(&mut self)
[src]
Clear all idle connections from the Pool, closing them.
Trait Implementations
impl<C: NetworkConnector<Stream = S>, S: NetworkStream + Send> NetworkConnector for Pool<C>
[src]
type Stream = PooledStream<S>
Type of Stream
to create
fn connect(
&self,
host: &str,
port: u16,
scheme: &str
) -> Result<PooledStream<S>>
[src]
&self,
host: &str,
port: u16,
scheme: &str
) -> Result<PooledStream<S>>
Connect to a remote address.