Trait KeyLookup

Source
pub(crate) trait KeyLookup<S: KeyStorage<K>, K: Key> {
    // Required methods
    fn item_stored_key(&self, bucket: usize, item: usize) -> S;
    fn item_full_key(&self, bucket: usize, item: usize) -> K;
}
Expand description

Trait for bucket arrays that include storage for keys

Keys are always used to index into the bucket array, but an array may also optionally include storage for the remaining portion.

Required Methods§

Source

fn item_stored_key(&self, bucket: usize, item: usize) -> S

Retrieve the stored key remainder bits for this item

Source

fn item_full_key(&self, bucket: usize, item: usize) -> K

Retrieve the key for a particular item, as a full width key

Implementors§

Source§

impl<'k, 'v, const N: usize, const CAP: usize, C: Count, K: Key, KS: KeyStorage<K>, V: Copy> KeyLookup<KS, K> for KeyValueBucketArray<'k, 'v, N, CAP, C, K, KS, V>