def TraceId.assert_random

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

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

540# Record the caller's assertion that these digits were generated randomly, so
541# that the random-trace-id flag is emitted with them. The caller is responsible
542# for the assertion; validation cannot establish it (law assert_random).
543def TraceId.assert_random(id: TraceId) -> TraceId:
544  match id:
545    case TraceId{value, random}:
546      TraceId{value, True{}}

Uses (2)

Used by (1)