pub trait SpanData<'a> {
// Required methods
fn id(&self) -> Id;
fn metadata(&self) -> &'static Metadata<'static>;
fn parent(&self) -> Option<&Id> ⓘ;
fn extensions(&self) -> Extensions<'_>;
fn extensions_mut(&self) -> ExtensionsMut<'_>;
// Provided method
fn is_enabled_for(&self, filter: FilterId) -> bool { ... }
}
Expand description
A stored representation of data associated with a span.
Required Methods§
Sourcefn extensions(&self) -> Extensions<'_>
Available on crate feature std
only.
fn extensions(&self) -> Extensions<'_>
std
only.Returns a reference to this span’s Extensions
.
The extensions may be used by Layer
s to store additional data
describing the span.
Sourcefn extensions_mut(&self) -> ExtensionsMut<'_>
Available on crate feature std
only.
fn extensions_mut(&self) -> ExtensionsMut<'_>
std
only.Returns a mutable reference to this span’s Extensions
.
The extensions may be used by Layer
s to store additional data
describing the span.
Provided Methods§
Sourcefn is_enabled_for(&self, filter: FilterId) -> bool
Available on crate feature registry
only.
fn is_enabled_for(&self, filter: FilterId) -> bool
registry
only.Returns true
if this span is enabled for the per-layer filter
corresponding to the provided FilterId
.
§Default Implementation
By default, this method assumes that the LookupSpan
implementation
does not support per-layer filtering, and always returns true
.