Skip to main content

Module context

Module context 

Source
Expand description

Ambient span context.

A task-local “current span” so child spans link to their parent without the caller threading (TraceId, RunId, SpanId) through every signature. SpanBuilder::run and the instrumentation macros set this for the duration of the instrumented body; spans created inside that body read it automatically. SpanBuilder::with_parent remains the explicit override for cross-task / cross-thread handoffs.

Structs§

SpanContext
The trace/run/span identity threaded down to child spans.

Functions§

current_span_context
The ambient span context for the current task, if one has been set.
scope_current
Run future with ctx installed as the ambient span context. Spans created inside the future link to ctx as their parent unless they set one explicitly.