Trait tracing_capture::Captured
source · pub trait Captured<'a>: Eq + PartialOrd + Sealed {
// Required methods
fn metadata(&self) -> &'static Metadata<'static>;
fn value(&self, name: &str) -> Option<&'a TracedValue>;
fn parent(&self) -> Option<CapturedSpan<'a>>;
}
Expand description
Uniting trait for CapturedSpan
s and CapturedEvent
s that allows writing generic
code in cases both should be supported.
Required Methods§
sourcefn metadata(&self) -> &'static Metadata<'static>
fn metadata(&self) -> &'static Metadata<'static>
Provides a reference to the span / event metadata.
sourcefn value(&self, name: &str) -> Option<&'a TracedValue>
fn value(&self, name: &str) -> Option<&'a TracedValue>
Returns a value for the specified field, or None
if the value is not defined.
sourcefn parent(&self) -> Option<CapturedSpan<'a>>
fn parent(&self) -> Option<CapturedSpan<'a>>
Returns the reference to the parent span, if any.
Object Safety§
This trait is not object safe.