Struct hyper_timeout::TimeoutConnector
[−]
[src]
pub struct TimeoutConnector<T> { /* fields omitted */ }
A connector that enforces as connection timeout
Methods
impl<T: Connect> TimeoutConnector<T>
[src]
fn new(connector: T, handle: &Handle) -> Self
Construct a new TimeoutConnector with a given connector implementing the Connect
trait
fn set_connect_timeout(&mut self, val: Option<Duration>)
Set the timeout for connecting to a URL.
Default is no timeout.
fn set_read_timeout(&mut self, val: Option<Duration>)
Set the timeout for the response.
Default is no timeout.
fn set_write_timeout(&mut self, val: Option<Duration>)
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]
T: Service<Error = Error> + 'static,
T::Response: AsyncRead + AsyncWrite,
T::Future: Future<Error = Error>,
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<Future<Item = Self::Response, Error = Self::Error>>
The future response value.
fn call(&self, req: Self::Request) -> Self::Future
Process the request and return the response asynchronously.