[][src]Struct hyper_timeout::TimeoutConnector

pub struct TimeoutConnector<T> { /* fields omitted */ }

A connector that enforces as connection timeout

Methods

impl<T: Connect> TimeoutConnector<T>[src]

pub fn new(connector: T) -> Self[src]

Construct a new TimeoutConnector with a given connector implementing the Connect trait

impl<T> TimeoutConnector<T>[src]

pub fn set_connect_timeout(&mut self, val: Option<Duration>)[src]

Set the timeout for connecting to a URL.

Default is no timeout.

pub fn set_read_timeout(&mut self, val: Option<Duration>)[src]

Set the timeout for the response.

Default is no timeout.

pub fn set_write_timeout(&mut self, val: Option<Duration>)[src]

Set the timeout for the request.

Default is no timeout.

Trait Implementations

impl<T: Debug> Debug for TimeoutConnector<T>[src]

impl<T: Connect> Connect for TimeoutConnector<T> where
    T: Connect<Error = Error> + 'static,
    T::Future: 'static, 
[src]

type Transport = TimeoutStream<T::Transport>

The connected IO Stream.

type Error = T::Error

An error occured when trying to connect.

type Future = Box<dyn Future<Item = (Self::Transport, Connected), Error = Self::Error> + Send>

A Future that will resolve to the connected Transport.

Auto Trait Implementations

impl<T> Sync for TimeoutConnector<T> where
    T: Sync

impl<T> Unpin for TimeoutConnector<T> where
    T: Unpin

impl<T> Send for TimeoutConnector<T> where
    T: Send

impl<T> UnwindSafe for TimeoutConnector<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for TimeoutConnector<T> where
    T: RefUnwindSafe

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T