def Draw.feed
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1335# Feed the next source word, or the source's error, to the trace ID draw or
1336# the span ID draw that the generation runs. A source error ends the draw,
1337# and so the generation, at once with SourceFailure (law feed_failure).
1338def Draw.feed(word: Result<&1, &1, U32 & String, U32>, draw: Draw) -> Step:
1339 match draw:
1340 case DrawTrace{trace, sampled}:
1341 Step.of_trace(TraceDraw.next(word, trace), sampled)
1342 case DrawSpan{span, trace_id, sampled}:
1343 Step.of_span(SpanDraw.next(word, span), trace_id, sampled)