Current in tracing_core::span - Rust (original) (raw)
pub struct Current { /* private fields */ }Expand description
Indicates what the Subscriber considers the “current” span.
As subscribers may not track a notion of a current span, this has three possible states:
- “unknown”, indicating that the subscriber does not track a current span,
- “none”, indicating that the current context is known to not be in a span,
- “some”, with the current span’s Id and Metadata.
Constructs a new Current that indicates the current context is a span with the given metadata and metadata.
Constructs a new Current that indicates the current context is _not_in a span.
Returns true if the Subscriber that constructed this Current tracks a current span.
If this returns true and id, metadata, or into_innerreturn None, that indicates that we are currently known to not be inside a span. If this returns false, those methods will also returnNone, but in this case, that is because the subscriber does not keep track of the currently-entered span.
Consumes self and returns the span Id and Metadata of the current span, if one exists and is known.
Borrows the Id of the current span, if one exists and is known.
Borrows the Metadata of the current span, if one exists and is known.