def Extract.read

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

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

3004# The extraction of a message whose only traceparent value `value` was read.
3005# The value is kept without the whitespace around it only once accepted, so a
3006# refused value is not read further.
3007def Extract.read(read: Result<&2, &2, TraceParentError, TraceParentV00>, value: String, +limits: Limits,
3008  +states: List<&2, String>, base: Maybe<&2, BaseContext>) -> Extraction:
3009  match read:
3010    case Fail{error}:
3011      Extract.kept(base, TraceParentRejected{error}, states)
3012    case Done{known}:
3013      Extract.state(limits, states, RemoteContext.from_traceparent(known), Text.trim_ows(value))

Uses (14)

Used by (1)