def Step.of_span
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1262# The generation that a span ID draw's step gives, for a context of
1263# `trace_id` with the sampled indication `sampled`: waiting for the draw's
1264# next word, the context once the span ID is drawn, or the draw's failure.
1265def Step.of_span(step: SpanStep, trace_id: TraceId, sampled: Bool) -> Step:
1266 match step:
1267 case NeedSpanWord{draw}:
1268 NeedWord{DrawSpan{draw, trace_id, sampled}}
1269 case DrawnSpanId{id}:
1270 Created{Context.from_ids(trace_id, id, sampled)}
1271 case SpanFailed{error}:
1272 Failed{error}