Module hash_map

Source
Expand description

Provides HashMap based on hashbrown’s implementation. Unlike hashbrown::HashMap, HashMap defaults to FixedHasher instead of RandomState. This provides determinism by default with an acceptable compromise to denial of service resistance in the context of a game engine.

Structs§

DefaultHasher
A Hasher instance implementing foldhash, optimized for speed.
Drain
A draining iterator over the entries of a HashMap in arbitrary order. The iterator element type is (K, V).
ExtractIf
A draining iterator over entries of a HashMap which don’t satisfy the predicate f(&k, &mut v) in arbitrary order. The iterator element type is (K, V).
HashMap
New-type for HashMap with FixedHasher as the default hashing provider. Can be trivially converted to and from a hashbrown HashMap using From.
IntoIter
An owning iterator over the entries of a HashMap in arbitrary order. The iterator element type is (K, V).
IntoKeys
An owning iterator over the keys of a HashMap in arbitrary order. The iterator element type is K.
IntoValues
An owning iterator over the values of a HashMap in arbitrary order. The iterator element type is V.
Iter
An iterator over the entries of a HashMap in arbitrary order. The iterator element type is (&'a K, &'a V).
IterMut
A mutable iterator over the entries of a HashMap in arbitrary order. The iterator element type is (&'a K, &'a mut V).
Keys
An iterator over the keys of a HashMap in arbitrary order. The iterator element type is &'a K.
OccupiedEntry
A view into an occupied entry in a HashMap. It is part of the Entry and EntryRef enums.
OccupiedError
The error returned by try_insert when the key already exists.
RandomState
A BuildHasher for fast::FoldHashers that are randomly initialized.
RawEntryBuilder
A builder for computing where in a HashMap a key-value pair would be stored.
RawEntryBuilderMut
A builder for computing where in a HashMap a key-value pair would be stored.
RawOccupiedEntryMut
A view into an occupied entry in a HashMap. It is part of the RawEntryMut enum.
VacantEntry
A view into a vacant entry in a HashMap. It is part of the Entry enum.
Values
An iterator over the values of a HashMap in arbitrary order. The iterator element type is &'a V.
ValuesMut
A mutable iterator over the values of a HashMap in arbitrary order. The iterator element type is &'a mut V.

Enums§

EntryRef
A view into a single entry in a map, which may either be vacant or occupied, with any borrowed form of the map’s key type.
RawEntryMut
A view into a single entry in a map, which may either be vacant or occupied.

Type Aliases§

Entry
Shortcut for Entry with FixedHasher as the default hashing provider.