TraceContext.Read.prefix: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 2874-2883 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=2874&end_line=2883 import Base # A later version is read by its known prefix (W3C 3.2.4 and 4.1.2): its first # 55 characters are read as version 00, which checks the trace ID, the parent # ID, the flags and the dashes between them at their own offsets, and then the # value must end or continue with a dash. A value that ends before its 55th # character, with no invalid character before, fails with UnexpectedEnd. def Read.prefix(+text: String) -> Result<&2, &2, Error, TraceParentV00>: do Result<&2, &2, Error, TraceParentV00>: known : TraceParentV00 <- TraceParentV00.parse("00" ++ String.drop(String.take(text, 55n), 2n)) rest : Unit <- Read.extension(String.drop(text, 55n)) return known Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.take https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=Read.extension https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceParentV00 https://jend.leeeet.dev/definition.txt?path=bend-trace-context@0.2.0.0/trace_context.bend&name=TraceParentV00.parse