def StateKey.is_valid
import bend-trace-context@0.2.0.0/trace_context.bend as TraceContextimport Base
1767# key = ( lcalpha / DIGIT ) 0*255( keychar ): 1 to 256 characters (W3C
1768# 3.3.2.2.1). Level 1's tenant@system restriction does not apply.
1769def StateKey.is_valid(text: String) -> Bool:
1770 match text:
1771 case SNil{}:
1772 False{}
1773 case SCon{char, tail}:
1774 Bool.and(StateChar.is_key_start(char), StateKey.valid.rest(tail, 255n))