Struct tracing_subscriber::registry::SpanRef [−][src]
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]
R: LookupSpan<'a>,
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>ⓘ
[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>ⓘ
[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 Layer
s 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 Layer
s to store additional data
describing the span.
Trait Implementations
Auto Trait Implementations
impl<'a, R> RefUnwindSafe for SpanRef<'a, R> where
R: RefUnwindSafe,
<R as LookupSpan<'a>>::Data: RefUnwindSafe,
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,
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,
R: Sync,
<R as LookupSpan<'a>>::Data: Sync,
impl<'a, R> Unpin for SpanRef<'a, R> where
<R as LookupSpan<'a>>::Data: Unpin,
<R as LookupSpan<'a>>::Data: Unpin,
impl<'a, R> UnwindSafe for SpanRef<'a, R> where
R: RefUnwindSafe,
<R as LookupSpan<'a>>::Data: UnwindSafe,
R: RefUnwindSafe,
<R as LookupSpan<'a>>::Data: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,