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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.