Trait tower_http::trace::OnRequest[][src]

pub trait OnRequest<B> {
    fn on_request(&mut self, request: &Request<B>, span: &Span);
}
This is supported on crate feature trace only.
Expand description

Trait used to tell Trace what to do when a request is received.

Required methods

fn on_request(&mut self, request: &Request<B>, span: &Span)[src]

Do the thing.

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> OnRequest<B> for ()[src]

fn on_request(&mut self, _: &Request<B>, _: &Span)[src]

Implementors

impl<B> OnRequest<B> for DefaultOnRequest[src]

fn on_request(&mut self, _: &Request<B>, _: &Span)[src]

impl<B, F> OnRequest<B> for F where
    F: FnMut(&Request<B>, &Span), 
[src]

fn on_request(&mut self, request: &Request<B>, span: &Span)[src]