Expand description
§Keyed Set: a hashbrown-based HashSet that indexes based on projections of its elements.
Ever wanted a HashMap<K, V>, but where V actually contains K (or at least can be projected to it)?
Well this is it.
The easiest way to define a projection is through a closure that you pass at construction, but you may also define your own key extractors as ZSTs that implement Default to gain a Default constructor for your Keyed Sets.
Structs§
- Default
Borrower - The default way to borrow a value.
- Drain
- An iterator over a
KeyedSetthat steals the values from it. - Drain
Filter - An iterator over a
KeyedSetthat only steals values that match a given predicate. - Into
Iter - An iterator over the
KeyedSetby value. - Iter
- An iterator over the
KeyedSetby reference. - IterMut
- An iterator over the
KeyedSetby mutable reference. - Keyed
Set - A
HashMap<K, V>whereKis a part ofV - Keyed
SetGuard - A guard that allows mutating a value, but which panics if the new value once dropped doesn’t have the same key.
- Vacant
Entry - A vacant entry into a
KeyedSet
Enums§
- Entry
- An entry into a
KeyedSet, allowing in-place modification of the value associated with the key if it exists.
Traits§
- IBorrower
- Allows defining alternatives to
core::ops::Deref - IEntry
- The trait magic that allows
KeyedSet::entryto work. - KeyExtractor
- Extracts the key from the value, allowing
KeyedSetto obtain its values’ keys.