def Limits.is_valid
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1626# The rules of a configuration, which must accept its own emitted
1627# representation: a traceparent input budget of at least 55 octets, the length
1628# of a v00 value, and a tracestate input budget no smaller than an output
1629# budget of at least 512 octets (spec #1, "Tracestate policy and resource
1630# bounds"; the 512-octet minimum comes from #8; law limits_bounds).
1631def Limits.is_valid(traceparent_input: Nat, tracestate_input: Nat, +tracestate_output: Nat) -> Bool:
1632 Bool.and(Nat.is_ge(traceparent_input, 55n),
1633 Bool.and(Nat.is_ge(tracestate_output, 512n), Nat.is_ge(tracestate_input, tracestate_output)))