def TraceDraw.check

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

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

1044# Check a complete trace ID candidate: zero and the excluded trace ID are
1045# retried; anything else is the trace ID drawn.
1046def TraceDraw.check(candidate: Maybe<&2, TraceId>, excluded: Maybe<&2, TraceId>, remaining: Nat) -> TraceStep:
1047  match candidate:
1048    case None{}:
1049      TraceDraw.retry(remaining, excluded)
1050    case Some{+id}:
1051      match excluded:
1052        case None{}:
1053          DrawnTraceId{id}
1054        case Some{+old}:
1055          TraceDraw.reuse(TraceId.is_eq(id, old), id, old, remaining)

Uses (7)

Used by (1)