def Extract.parsed

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

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

2981# An accepted message whose tracestate fields were parsed: an accepted state
2982# keeps the pair, which can be forwarded, and a refused one is discarded
2983# whole, keeping the traceparent (spec #1) but no pair, since the pair was not
2984# accepted whole.
2985def Extract.parsed(parsed: Result<&2, &2, StateError, TraceState>, remote: RemoteContext, text: String,
2986  states: List<&2, String>) -> Extraction:
2987  match parsed:
2988    case Fail{error}:
2989      Extraction{Extract.incoming(remote, TraceState.empty(), None{}), TraceParentAccepted{}, StateDiscarded{error}}
2990    case Done{state}:
2991      Extraction{Extract.incoming(remote, state, Some{ReceivedPair{text, states}}), TraceParentAccepted{},
2992        StateAccepted{}}

Uses (13)

Used by (1)