Struct tokio_timeit_middleware::Timeit
[−]
[src]
pub struct Timeit<S, TimeSink> { /* fields omitted */ }
A middleware that times how long it takes the downstream service S
to
respond to a request with a response. The recorded time::Duration
s are
passed to the TimeSink
.
Methods
impl<S, TimeSink> Timeit<S, TimeSink>
[src]
Trait Implementations
impl<S, TimeSink, TimeSinkFn> Service for Timeit<S, TimeSink> where
S: Service,
TimeSink: Deref<Target = TimeSinkFn> + Clone,
TimeSinkFn: Fn(Duration),
[src]
S: Service,
TimeSink: Deref<Target = TimeSinkFn> + Clone,
TimeSinkFn: Fn(Duration),
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 = EndTimeit<S::Future, TimeSink>
The future response value.
fn call(&self, request: Self::Request) -> Self::Future
Process the request and return the response asynchronously.