tracing_capture

Trait 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.

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.

Implementors§

Source§

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

Source§

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