[][src]Struct hyper::client::pool::Pool

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]

pub fn new(config: Config) -> Pool<DefaultConnector>[src]

Creates a Pool with a DefaultConnector.

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]

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

Auto Trait Implementations

impl<C> Send for Pool<C> where
    C: Send,
    <C as NetworkConnector>::Stream: Send

impl<C> Sync for Pool<C> where
    C: Sync,
    <C as NetworkConnector>::Stream: Send

Blanket Implementations

impl<F> NetworkConnector for F where
    F: Fn(&str, u16, &str) -> Result<TcpStream, Error>, 
[src]

type Stream = HttpStream

Type of Stream to create

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any
[src]

fn get_type(&self) -> TypeId[src]

Get the TypeId of this object.