[][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, handle: &Handle) -> Self[src]

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

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> Service for TimeoutConnector<T> where
    T: Service<Error = Error> + 'static,
    T::Response: AsyncRead + AsyncWrite,
    T::Future: Future<Error = Error>, 
[src]

type Request = T::Request

Requests handled by the service.

type Response = TimeoutStream<T::Response>

Responses given by the service.

type Error = T::Error

Errors produced by the service.

type Future = Box<dyn Future<Item = Self::Response, Error = Self::Error>>

The future response value.

Auto Trait Implementations

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

impl<T> !Sync for TimeoutConnector<T>

impl<T> !Send for TimeoutConnector<T>

impl<T> !UnwindSafe for TimeoutConnector<T>

impl<T> !RefUnwindSafe for TimeoutConnector<T>

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

impl<T> Connect for T where
    T: Service<Request = Uri, Error = Error> + 'static,
    <T as Service>::Response: AsyncRead,
    <T as Service>::Response: AsyncWrite,
    <T as Service>::Future: Future,
    <<T as Service>::Future as Future>::Error == Error
[src]

type Output = <T as Service>::Response

The connected Io Stream.

type Future = <T as Service>::Future

A Future that will resolve to the connected Stream.