Trait tower_http::trace::OnEos[][src]

pub trait OnEos {
    fn on_eos(
        self,
        trailers: Option<&HeaderMap>,
        stream_duration: Duration,
        span: &Span
    ); }
This is supported on crate feature trace only.
Expand description

Trait used to tell Trace what to do when a stream closes.

Required methods

fn on_eos(
    self,
    trailers: Option<&HeaderMap>,
    stream_duration: Duration,
    span: &Span
)
[src]

Do the thing.

stream_duration is the duration since the response was 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.

Implementations on Foreign Types

impl OnEos for ()[src]

fn on_eos(self, _: Option<&HeaderMap>, _: Duration, _: &Span)[src]

Implementors

impl OnEos for DefaultOnEos[src]

fn on_eos(
    self,
    trailers: Option<&HeaderMap>,
    stream_duration: Duration,
    _span: &Span
)
[src]

impl<F> OnEos for F where
    F: FnOnce(Option<&HeaderMap>, Duration, &Span), 
[src]

fn on_eos(
    self,
    trailers: Option<&HeaderMap>,
    stream_duration: Duration,
    span: &Span
)
[src]