Expand description
Re-exports of map types and utilities.
This module exports the following types:
HashMapandHashSetfrom the standard library orhashbrowncrate. The “map-hashbrown” feature can be used to force the use ofhashbrown, and is required inno_stdenvironments.- [
IndexMap] and [IndexSet] from theindexmapcrate, if the “map-indexmap” feature is enabled. - The previously-listed hash map types prefixed with
Fb. These are type aliases withFixedBytes<N>as the key, andFbBuildHasheras the hasher builder. This hasher is optimized for hashing fixed-size byte arrays, and wraps around the default hasher builder. It performs best when the hasher isfxhash, which is enabled by default with the “map-fxhash” feature. - The previously-listed hash map types prefixed with
Selector,Address, andB256. These useFbBuildHasherwith the respective fixed-size byte array as the key. See the previous point for more information.
Unless specified otherwise, the default hasher builder used by these types is
DefaultHashBuilder. This hasher prioritizes speed over security. Users who require HashDoS
resistance should enable the “rand” feature so that the hasher is initialized using a random
seed.
Modules§
- hash_
map - A hash map implemented with quadratic probing and SIMD lookup.
- hash_
set - A hash set implemented as a
HashMapwhere the value is().
Structs§
- FbBuild
Hasher BuildHasheroptimized for hashing fixed-size byte arrays.- FbHasher
Hasheroptimized for hashing fixed-size byte arrays.
Enums§
- Entry
- A view into a single entry in a map, which may either be vacant or occupied.
Type Aliases§
- Address
Hash Map HashMapoptimized for hashingAddress.- Address
Hash Set HashSetoptimized for hashingAddress.- B256
Hash Map HashMapoptimized for hashingB256.- B256
Hash Set HashSetoptimized for hashingB256.- Default
Hash Builder - The default
BuildHasherused byHashMapandHashSet. - Default
Hasher - The default
Hasherused byHashMapandHashSet. - FbHash
Map HashMapoptimized for hashing fixed-size byte arrays.- FbHash
Set HashSetoptimized for hashing fixed-size byte arrays.- HashMap
- A
HashMapusing the default hasher. - HashSet
- A
HashSetusing the default hasher. - Selector
Hash Map HashMapoptimized for hashingSelector.- Selector
Hash Set HashSetoptimized for hashingSelector.