pub trait TrieKey: Default {
type Store: KeyStore<Self>;
// Required method
fn as_bytes(&self) -> &[u8] ⓘ;
}Expand description
A key type that can be stored in a trie.
Each key type chooses its storage backend via the associated Store type.
The as_bytes() method provides the byte representation used for trie
traversal (bit extraction, divergence comparison).
The Default bound is required because both store backends reserve index 0
as a dummy entry (so that key index 0 can serve as the “empty” sentinel in
node children arrays). K::default() becomes the dummy entry in VecKeyStore.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".