TraceContext.Utf8.length: def of bend-trace-context@0.2.0.0 Import: import bend-trace-context@0.2.0.0/trace_context.bend as TraceContext Lines 2006-2015 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=2006&end_line=2015 import Base # The UTF-8 octets of a text, in which the laws state every budget. Emission # measures keys and values with it, at most 256 characters each; parsing # measures received text with Utf8.left instead, which stops counting past # the budget. def Utf8.length(text: String) -> Nat: match text: case SNil{}: 0n case SCon{char, tail}: Nat.add(Utf8.width(char), Utf8.length(tail)) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add 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=Utf8.width