logo
pub struct FmtContext<'a, S, N> { /* private fields */ }
Expand description

Provides the current span context to a formatter.

Implementations

Visits every span in the current context with a closure.

The provided closure will be called first with the current span, and then with that span’s parent, and then that span’s parent, and so on until a root span is reached.

Returns metadata for the span with the given id, if it exists.

If this returns None, then no span exists for that ID (either it has closed or the ID is invalid).

Returns stored data for the span with the given id, if it exists.

If this returns None, then no span exists for that ID (either it has closed or the ID is invalid).

Returns true if an active span exists for the given Id.

Returns stored data for the span that the wrapped subscriber considers to be the current.

If this returns None, then we are not currently within a span.

👎 Deprecated since 0.2.19:

wraps layer::Context::scope, which is deprecated

Returns an iterator over the stored data for all the spans in the current context, starting the root of the trace tree and ending with the current span.

Returns the current span for this formatter.

Returns the field formatter configured by the subscriber invoking format_event.

The event formatter may use the returned field formatter to format the fields of any events it records.

Trait Implementations

Formats the value using the given formatter. Read more

Format the provided fields to the provided writer, returning a result.

Record additional field(s) on an existing span. Read more

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more