Trait SpanExt

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§