🛈 Note: This is pre-release documentation for the upcoming tracing 0.2.0 ecosystem.

For the release documentation, please see docs.rs, instead.

Trait tracing_subscriber::registry::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<'_>

Available on crate feature std only.

Returns a reference to this span’s Extensions.

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

source

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

Available on crate feature std only.

Returns a mutable reference to this span’s Extensions.

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

Provided Methods§

source

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

Available on crate feature registry only.

Returns true if this span is enabled for the per-subscriber filter corresponding to the provided FilterId.

§Default Implementation

By default, this method assumes that the LookupSpan implementation does not support per-subscriber filtering, and always returns true.

Implementors§

source§

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

Available on crate features registry and std only.