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 CapturedSpans and CapturedEvents that allows writing generic code in cases both should be supported.

Required Methods§

source

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

Provides a reference to the span / event metadata.

source

fn value(&self, name: &str) -> Option<&'a TracedValue>

Returns a value for the specified field, or None if the value is not defined.

source

fn parent(&self) -> Option<CapturedSpan<'a>>

Returns the reference to the parent span, if any.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> Captured<'a> for CapturedEvent<'a>

source§

impl<'a> Captured<'a> for CapturedSpan<'a>