Expand description
Logical identities, shared cache keys and rollout cohorts.
Key construction follows the portable protocol (W01–W03): URI component escaping, tracked entity hash tags, ordered argument pairs, the frame key suffix, and FNV-1a cohorts over UTF-16 code units.
Structs§
- Identity
- A normalized logical identity. Ordered arguments retain caller order;
use
normalize_argsto build them from a host-language record. - Keys
- Derived key strings of one identity.
Enums§
- ArgValue
- A host scalar accepted as a key argument.
- Identity
Error - Why an identity cannot form a key.
Traits§
- Into
KeyId - Converts an entity identifier to the text used in a cache key.
Functions§
- cohort
- Deterministic rollout sample in
[0, 100)for a logical key and layer or shadow discriminator: FNV-1a over the UTF-16 units ofkey:discriminator. - cohort_
hash - FNV-1a 32-bit hash over the UTF-16 code units of
logical_key:discriminator; the integer numerator behindcohort. - compare_
utf16 - Compare two strings by UTF-16 code units, as JavaScript’s
<does. - escape_
component encodeURIComponentescaping of one component.- js_
number_ to_ string - Spell a number the way JavaScript’s
String(number)does. - keys
- Build every key of an identity.
- normalize_
args - Normalize a record of key arguments: omit absent values, spell scalars the JavaScript way, and sort names by UTF-16 code units.