Struct tracing_subscriber::registry::SpanRef[][src]

pub struct SpanRef<'a, R: LookupSpan<'a>> { /* fields omitted */ }

A reference to span data and the associated registry.

This type implements all the same methods as SpanData, and provides additional methods for querying the registry based on values from the span.

Implementations

impl<'a, R> SpanRef<'a, R> where
    R: LookupSpan<'a>, 
[src]

pub fn id(&self) -> Id[src]

Returns this span’s ID.

pub fn metadata(&self) -> &'static Metadata<'static>[src]

Returns a static reference to the span’s metadata.

pub fn name(&self) -> &'static str[src]

Returns the span’s name,

pub fn fields(&self) -> &FieldSet[src]

Returns a list of fields defined by the span.

pub fn parent_id(&self) -> Option<&Id>[src]

Returns the ID of this span’s parent, or None if this span is the root of its trace tree.

pub fn parent(&self) -> Option<Self>[src]

Returns a SpanRef describing this span’s parent, or None if this span is the root of its trace tree.

pub fn parents(&self) -> Parents<'a, R>

Notable traits for Parents<'a, R>

impl<'a, R> Iterator for Parents<'a, R> where
    R: LookupSpan<'a>, 
type Item = SpanRef<'a, R>;
[src]

Returns an iterator over all parents of this span, starting with the immediate parent.

The iterator will first return the span’s immediate parent, followed by that span’s parent, followed by that span’s parent, and so on, until a it reaches a root span.

pub fn from_root(&self) -> FromRoot<'a, R>

Notable traits for FromRoot<'span, R>

impl<'span, R> Iterator for FromRoot<'span, R> where
    R: LookupSpan<'span>, 
type Item = SpanRef<'span, R>;
[src]

Returns an iterator over all parents of this span, starting with the root of the trace tree.

The iterator will return the root of the trace tree, followed by the next span, and then the next, until this span’s immediate parent is returned.

Note: if the “smallvec” feature flag is not enabled, this may allocate.

pub fn extensions(&self) -> Extensions<'_>[src]

Returns a reference to this span’s Extensions.

The extensions may be used by Layers to store additional data describing the span.

pub fn extensions_mut(&self) -> ExtensionsMut<'_>[src]

Returns a mutable reference to this span’s Extensions.

The extensions may be used by Layers to store additional data describing the span.

Trait Implementations

impl<'a, R: Debug + LookupSpan<'a>> Debug for SpanRef<'a, R> where
    R::Data: Debug
[src]

Auto Trait Implementations

impl<'a, R> RefUnwindSafe for SpanRef<'a, R> where
    R: RefUnwindSafe,
    <R as LookupSpan<'a>>::Data: RefUnwindSafe

impl<'a, R> Send for SpanRef<'a, R> where
    R: Sync,
    <R as LookupSpan<'a>>::Data: Send

impl<'a, R> Sync for SpanRef<'a, R> where
    R: Sync,
    <R as LookupSpan<'a>>::Data: Sync

impl<'a, R> Unpin for SpanRef<'a, R> where
    <R as LookupSpan<'a>>::Data: Unpin

impl<'a, R> UnwindSafe for SpanRef<'a, R> where
    R: RefUnwindSafe,
    <R as LookupSpan<'a>>::Data: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.