def Step.of_trace

bend-trace-context@0.2.0.0 · trace_context.bend:1292

import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext
import Base

1292# The generation that a trace ID draw's step gives, for a root or a restart
1293# with the sampled indication `sampled`: waiting for the draw's next word,
1294# the root's span ID draw once the trace ID is drawn (SpanPlan.root), or the
1295# draw's failure.
1296def Step.of_trace(step: TraceStep, sampled: Bool) -> Step:
1297  match step:
1298    case NeedTraceWord{draw}:
1299      NeedWord{DrawTrace{draw, sampled}}
1300    case DrawnTraceId{id}:
1301      SpanPlan.draw(SpanPlan.root(id, sampled))
1302    case TraceFailed{error}:
1303      Failed{error}

Uses (6)

Used by (2)