tracing_subscriber::registry

Trait SpanData

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

Source

fn id(&self) -> Id

Returns this span’s ID.

Source

fn metadata(&self) -> &'static Metadata<'static>

Returns a reference to the span’s Metadata.

Source

fn parent(&self) -> Option<&Id>

Returns a reference to the ID

Source

fn extensions(&self) -> Extensions<'_>

Returns a reference to this span’s Extensions.

The extensions may be used by Layers to store additional data describing the span.

Source

fn extensions_mut(&self) -> ExtensionsMut<'_>

Returns a mutable reference to this span’s Extensions.

The extensions may be used by Layers to store additional data describing the span.

Provided Methods§

Source

fn is_enabled_for(&self, filter: FilterId) -> bool

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.

Implementors§

Source§

impl<'a> SpanData<'a> for Data<'a>