Trait tower_http::trace::OnBodyChunk[][src]

pub trait OnBodyChunk<B> {
    fn on_body_chunk(&mut self, chunk: &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 body chunk has been sent.

Required methods

fn on_body_chunk(&mut self, chunk: &B, latency: Duration, span: &Span)[src]

Do the thing.

latency is the duration since the response was sent or since the last body chunk as sent.

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.

If you’re using hyper as your server B will most likely be Bytes.

Implementations on Foreign Types

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

fn on_body_chunk(&mut self, _: &B, _: Duration, _: &Span)[src]

Implementors

impl<B> OnBodyChunk<B> for DefaultOnBodyChunk[src]

fn on_body_chunk(&mut self, _: &B, _: Duration, _: &Span)[src]

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

fn on_body_chunk(&mut self, chunk: &B, latency: Duration, span: &Span)[src]