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::record
s.
Required Methods§
Sourcefn record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
fn record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
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.
Sourcefn must_record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
fn must_record_hierarchical<Q, V>(&self, field: &Q, value: V) -> &Self
Same as SpanExt::record_hierarchical()
, but panics.
§Panics
In case none of tracing::Span
s 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.