pub trait SpanExt: Sealed {
    // Required methods
    fn record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
       where Q: AsField + Display + ?Sized,
             V: Value;
    fn must_record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
       where Q: AsField + Display + ?Sized,
             V: Value;
}
Expand description

Extension of a tracing::Span providing more ergonomic handling of tracing::Span::records.

Required Methods§

source

fn record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
where Q: AsField + Display + ?Sized, V: Value,

Same as tracing::Span::record(), but ensures that the provided field’s value will be written into the first tracing::Span with this field up by hierarchy.

source

fn must_record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
where Q: AsField + Display + ?Sized, V: Value,

Same as SpanExt::record_hierarchical(), but panics.

Panics

In case none of tracing::Spans in the hierarchy has the provided field.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl SpanExt for Span

source§

fn record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
where Q: AsField + Display + ?Sized, V: Value,

source§

fn must_record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
where Q: AsField + Display + ?Sized, V: Value,

Implementors§