def TraceParentV00.parse

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

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

467# Parse a strict traceparent v00 value: exactly "00-", 32 lowercase
468# hexadecimal digits, "-", 16 digits, "-" and two digits; the IDs must not be
469# all zero. No whitespace, case folding or suffix is accepted, and every flag
470# byte is kept as received.
471# This is the strict wire codec, not a complete W3C propagator:
472# TraceParent.read and Context.extract apply the processing rules of W3C 3.2.4
473# and 4.1.2, such as reading later versions by their known prefix.
474# Laws: roundtrip, inverse and formatted_length.
475def TraceParentV00.parse(text: String) -> Result<&2, &2, Error, TraceParentV00>:
476  do Result<&2, &2, Error, TraceParentV00>:
477    version : Parsed<2n> <- Parse.digits(2n, text, 0n)
478    Parse.start(version)

Uses (8)

Used by (2)