def Parse.parent

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

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

433# After the trace ID: the parent ID, which must not be all zero, its "-" at
434# offset 52 and the flag digits at offset 53.
435def Parse.parent(trace_id: Digits.NonZero<32n>, parsed: Parsed<16n>) ->
436  Result<&2, &2, Error, TraceParentV00>:
437  match parsed:
438    case Parsed{parent_digits, rest}:
439      do Result<&2, &2, Error, TraceParentV00>:
440        parent_id : Digits.NonZero<16n> <- Parse.nonzero(16n, parent_digits, ParentIdField{})
441        after : String <- Parse.separator(rest, 52n)
442        flags : Parsed<2n> <- Parse.digits(2n, after, 53n)
443        Parse.flags(trace_id, parent_id, flags)

Uses (12)

Used by (1)