Skip to main content

Module index

Module index 

Source
Expand description

Memory-efficient index structures for mapping translated keys to values.

§Multiple Values for a Key

Keys are translated into a compressed, fixed-size representation using a Translator. Depending on the size of the representation, this can lead to a non-negligible number of collisions (even if the original keys are collision-free). To workaround this issue, get returns all values that map to the same translated key. If the same key is inserted multiple times (and old values are not removed), all values will be returned.

§Warning

If the Translator maps many keys to the same translated key, the performance of Index will degrade substantially (each conflicting key may contain the desired value).

Modules§

ordered
Implementation of Ordered that uses an ordered map internally to map translated keys to arbitrary values. Beyond the standard Unordered implementation, this variant adds the capability to retrieve values associated with both next and previous translated keys of a given key. There is no ordering guarantee provided over the values associated with each key. Ordering applies only to the translated key space.
partitioned
Index implementations that partition the key space across 2^(8*P) independent partitions selected by a fixed-size P-byte prefix of the key.
unordered
A memory-efficient index that uses an unordered map internally to map translated keys to arbitrary values. If you require ordering over the map’s keys, consider crate::index::ordered::Index instead.

Traits§

Cursor
A mutable iterator over the values associated with a translated key, allowing in-place modifications.
Factory
A trait for index types that can be constructed from a metrics context and translator.
Ordered
A trait defining the additional operations provided by a memory-efficient index that allows ordered traversal of the indexed keys.
Unordered
A trait defining the operations provided by a memory-efficient index that maps translated keys to arbitrary values, with no ordering assumed over the key space.