def Scan.state

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

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

2251# The scan keeps only the first entry of each key and stops at a 33rd member,
2252# so this check is not expected to fail: the laws prove it passes for
2253# normalized values, and the corpus exercises the rest. A failure would be
2254# reported as too many members.
2255def Scan.state(entries: List<&2, StateEntry>, valid: Bool,
2256  evidence: {TraceState.is_valid(entries) == valid : Bool}) -> Result<&2, &2, StateError, TraceState>:
2257  match valid:
2258    case True{}:
2259      Done{TraceState{entries, evidence}}
2260    case False{}:
2261      Fail{TooManyMembers{}}

Uses (7)

Used by (1)