#hash-set #hash-map #hash

hashable

HashMap and HashSet replacements that implement the Hash trait -- HashableHashMap and HashableHashSet

1 unstable release

0.0.0 Feb 13, 2021

#80 in #hash-set

Download history 2/week @ 2025-07-30 58/week @ 2025-08-06 13/week @ 2025-08-13 48/week @ 2025-08-20 72/week @ 2025-08-27 46/week @ 2025-09-03 32/week @ 2025-09-10 26/week @ 2025-09-17 31/week @ 2025-09-24 21/week @ 2025-10-01 9/week @ 2025-10-08 37/week @ 2025-10-15 72/week @ 2025-10-22 97/week @ 2025-10-29 48/week @ 2025-11-05

256 downloads per month
Used in 4 crates (2 directly)

MIT license

13KB
272 lines

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 satisfied

The 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);

crates.io docs.rs LICENSE

This Rust library provides HashMap and HashSet replacements that implement the Hash trait -- HashableHashMap and HashableHashSet.

Contribution

Contributions are welcome! Please fork the library, push changes to your fork, and send a pull request. All contributions are shared under an MIT license unless explicitly stated otherwise in the pull request.

License

Hashable is copyright 2021 Jonathan Nadal. It is made available under the MIT License.

Dependencies

~310–680KB
~14K SLoC