Trait tower_http::trace::OnResponse[][src]

pub trait OnResponse<B> {
    fn on_response(self, response: &Response<B>, latency: Duration, span: &Span);
}
This is supported on crate feature trace only.
Expand description

Trait used to tell Trace what to do when a response has been produced.

Required methods

fn on_response(self, response: &Response<B>, latency: Duration, span: &Span)[src]

Do the thing.

latency is the duration since the request was received.

span is the tracing Span, corresponding to this request, produced by the closure passed to TraceLayer::make_span_with. It can be used to record field values that weren’t known when the span was created.

Implementations on Foreign Types

impl<B> OnResponse<B> for ()[src]

fn on_response(self, _: &Response<B>, _: Duration, _: &Span)[src]

Implementors

impl<B> OnResponse<B> for DefaultOnResponse[src]

fn on_response(self, response: &Response<B>, latency: Duration, _: &Span)[src]

impl<B, F> OnResponse<B> for F where
    F: FnOnce(&Response<B>, Duration, &Span), 
[src]

fn on_response(self, response: &Response<B>, latency: Duration, span: &Span)[src]