Struct tracing_core::span::Current[][src]

pub struct Current { /* fields omitted */ }
Expand description

Indicates what the collector considers the “current” span.

As collectors may not track a notion of a current span, this has three possible states:

  • “unknown”, indicating that the collector 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.

Implementations

Constructs a new Current that indicates the current context is a span with the given id and metadata.

Constructs a new Current that indicates the current context is not in a span.

Constructs a new Current that indicates the collector does not track a current span.

Returns true if the collector that constructed this Current tracks a current span.

If this returns true and id, metadata, or into_inner return None, that indicates that we are currently known to not be inside a span. If this returns false, those methods will also return None, but in this case, that is because the collector 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.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.