Under heavy development. This site describes the intended 1.0 language. Current features and performance vary. Development status
Sn50SnThe SnAPI programming language
Snapshot · Oct 24, 2026 · Frozen documentation

HashKeyPolicy

Defines the exact safe readonly hash/equality operations for a key type.

Sn is under heavy development. This reference includes the intended 1.0 design; features may be incomplete in the current compiler. Read the status →

Module std.collections

import std.collections;

Public declaration contracts and authored examples. A page can document several related symbols. Implementation bodies are excluded.

HashKeyPolicy

pub concept HashKeyPolicy<Self, K>

Defines the exact safe readonly hash/equality operations for a key type.

Equals must be an equivalence relation. Equal keys must hash equally; hash and equality results must remain stable while keys are stored. Neither operation may mutate or invalidate owning container storage. These semantic laws are caller obligations beyond structural signature checking. Calls retain no key borrow and introduce no required allocation, locking, boxing or unsafe effect. Self: Concrete owned policy type. K: Exact key type, borrowed readonly by both operations.

Documentation snapshot: October 24, 2026 About versions ↗
Searching Development · language & standard library