TraceContext.Context.extract: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 3027-3044 of bend-trace-context@0.2.0.0/trace_context.bend: https://jend.leeeet.dev/read.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&start_line=3027&end_line=3044 import Base # Extract the trace context of a received message from its carrier, with # `base` as the context to keep when the message has no usable traceparent # (spec #1, user stories 14, 15, 16, 24 and 25): # - no traceparent field keeps the base, TraceParentAbsent{}; # - more than one traceparent field, whatever the case of their names, is # refused, and so is a single value that TraceParent.read refuses; the # base is kept, TraceParentRejected{error}; # - an accepted value gives the incoming context and replaces the base: its # tracestate fields, whatever the case of their names, are read in # arrival order as their comma-joined combination, within the tracestate # input budget; refused fields are discarded whole, keeping the # traceparent; # - without an accepted traceparent, tracestate fields are not read. # Laws: extract_absent, extract_repeated, extract_refused, extract_read, # state_independent and received_bounds. def Context.extract(+limits: Limits, +carrier: List<&2, Header>, base: Maybe<&2, BaseContext>) -> Extraction: Extract.parents(limits, Carrier.values(carrier, Carrier.traceparent_name()), Carrier.values(carrier, Carrier.tracestate_name()), base) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=BaseContext https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Carrier.traceparent_name https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Carrier.tracestate_name https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Carrier.values https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Extract.parents https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Extraction https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Header https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Limits