Struct tokio_middleware::Timeout
[−]
[src]
pub struct Timeout<S> { /* fields omitted */ }
Abort requests that are taking too long
Methods
impl<S> Timeout<S>
[src]
pub fn new(upstream: S, timer: Timer, duration: Duration) -> Timeout<S>
[src]
Crate a new Timeout
with the given upstream
service.
Requests will be limited to duration
and aborted once the limit has
been reached.
Trait Implementations
impl<S: Clone> Clone for Timeout<S>
[src]
fn clone(&self) -> Timeout<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S, E> Service for Timeout<S> where
S: Service<Error = E>,
E: From<TimeoutError<S::Future>>,
[src]
S: Service<Error = E>,
E: From<TimeoutError<S::Future>>,
type Request = S::Request
Requests handled by the service.
type Response = S::Response
Responses given by the service.
type Error = S::Error
Errors produced by the service.
type Future = Timeout<S::Future>
The future response value.
fn call(&self, request: Self::Request) -> Self::Future
[src]
Process the request and return the response asynchronously.