def SpanDraw.result
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1217# The span ID of a finished span ID draw, or why it failed, as
1218# TraceDraw.result; law span_id_ends shows that the word budget of
1219# SpanId.generate_with makes the unfinished case unreachable.
1220def SpanDraw.result(step: SpanStep) -> Result<&2, &2, GenerationError, SpanId>:
1221 match step:
1222 case DrawnSpanId{id}:
1223 Done{id}
1224 case SpanFailed{error}:
1225 Fail{error}
1226 case NeedSpanWord{draw}:
1227 Fail{ExhaustedSpanId{}}