[−][src]Trait tracing_subscriber::registry::LookupMetadata
Provides access to stored span metadata.
Subscribers which store span metadata and associate it with span IDs should
implement this trait; if they do, any Layer
s wrapping them can look up
metadata via the Context
type's metadata()
method.
Required methods
fn metadata(&self, id: &Id) -> Option<&'static Metadata<'static>>
Returns metadata for tne span with the given id
, if it exists.
If no span exists for the provided ID (e.g. the span has closed and been
removed from the registry, or the ID is invalid), this should return None
.
Provided methods
fn exists(&self, id: &Id) -> bool
Returns true
if a span with the given id
exists, false otherwise.
Note: The default implementation of this method is simply:
fn exists(&self, id: &span::Id) -> bool { self.metadata(id).is_some() }
If the subscriber has a faster way of determining whether a span exists for a given ID (e.g., if the ID is greater than the current value of an increasing ID counter, etc), this method may be overridden as an optimization.
Implementors
impl<L> LookupMetadata for L where
L: for<'a> LookupSpan<'a>,
[src]
L: for<'a> LookupSpan<'a>,
impl<N, E, F, W> LookupMetadata for Subscriber<N, E, F, W> where
Layered<F, Formatter<N, E, W>>: LookupMetadata,
[src]
Layered<F, Formatter<N, E, W>>: LookupMetadata,