Expand description
This library provides HashMap and HashSet replacements that implement the Hash
trait – HashableHashMap and HashableHashSet.
§Example
The following is rejected by the compiler:
ⓘ
let mut inner_set = std::collections::HashSet::new();
inner_set.insert("inner value");
let mut outer_set = std::collections::HashSet::new();
outer_set.insert(inner_set);error[E0277]: the trait bound `HashSet<&str>: Hash` is not satisfiedThe error can be resolved by swapping the inner HashSet with HashableHashSet:
let mut inner_set = hashable::HashableHashSet::new();
inner_set.insert("inner value");
let mut outer_set = std::collections::HashSet::new();
outer_set.insert(inner_set);Structs§
- Hashable
Hash Map - A
HashMapwrapper that implementsHashby sorting pre-hashed entries and feeding those back into the passed-inHasher. - Hashable
Hash Set - A
HashSetwrapper that implementsHashby sorting pre-hashed entries and feeding those back into the passed-inHasher.