def SpanDraw.take

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

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

1179# Add a word to the current span ID candidate. The second word completes it,
1180# most significant first, and the candidate is checked.
1181def SpanDraw.take(word: U32, remaining: Nat, words: SpanWords, excluded: Maybe<&2, SpanId>) -> SpanStep:
1182  match words:
1183    case NoSpanWord{}:
1184      NeedSpanWord{SpanDraw{remaining, OneSpanWord{word}, excluded}}
1185    case OneSpanWord{first}:
1186      SpanDraw.check(SpanId.from_words(first, word), excluded, remaining)

Uses (9)

Used by (1)