The map key ordering used by deterministic encoding.
RFC 8949 defines two deterministic key orderings. They agree whenever
all keys encode to the same length, but differ otherwise: for example,
100 (0x1864) sorts after -1 (0x20) bytewise, but before it
length-first.
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bytewise lexicographic order of the keys’ deterministic encodings.
This is the order required by the core deterministic encoding
requirements (RFC 8949 §4.2.1) and is the recommended choice for
new protocols; COSE (RFC 9052) and friends use it.
Length-first order: keys with shorter encodings sort earlier, and
keys of equal length sort bytewise.
This is the “Canonical CBOR” ordering of RFC 7049 §3.9, kept in
RFC 8949 §4.2.3 for backwards compatibility. Use it to interoperate
with protocols and implementations built on the older rule (for
example, ciborium’s canonical module).