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§
- Span
Context - 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
futurewithctxinstalled as the ambient span context. Spans created inside the future link toctxas their parent unless they set one explicitly.