TraceContext.TraceState.parse_fields: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 2288-2301 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=2288&end_line=2301 import Base # Parse repeated tracestate field values, in arrival order, as their # comma-joined combination (W3C 3.3.2). The combined value, joining commas # included, must fit the tracestate input budget; a larger one is refused with # StateTooLarge before any member is read, without measuring the rest. Then: # empty members are ignored, and so is optional whitespace before a member and # after its value; every nonempty member must be a valid entry (InvalidEntry) # and counts toward the 32 allowed (TooManyMembers); the first entry of each # key is kept. An error discards the whole state; a valid traceparent stays # valid (spec #1). W3C 3.3: parse tracestate only for a message whose # traceparent was parsed. # Laws: fields_join, over_budget, within_budgets, first_wins and the others of # section 10 of LAWS.bend. def TraceState.parse_fields(limits: Limits, +fields: List<&2, String>) -> Result<&2, &2, StateError, TraceState>: Scan.within(Utf8.left_fields(fields, Some{Limits.tracestate_input(limits)}), fields) 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=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Limits https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Limits.tracestate_input https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Scan.within https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=StateError https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceState https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Utf8.left_fields