#data-structure #hashmap

keyed-set

Keyed Set: a hashbrown-based HashSet that indexes based on projections of its elements

9 unstable releases (3 breaking)

0.4.5 Mar 29, 2023
0.4.4 Dec 21, 2022
0.4.2 Nov 14, 2022
0.3.0 Nov 9, 2022
0.1.0 Nov 8, 2022

#229 in Data structures

Download history 764/week @ 2023-02-04 829/week @ 2023-02-11 938/week @ 2023-02-18 692/week @ 2023-02-25 920/week @ 2023-03-04 916/week @ 2023-03-11 886/week @ 2023-03-18 1240/week @ 2023-03-25 1487/week @ 2023-04-01 1388/week @ 2023-04-08 2314/week @ 2023-04-15 2359/week @ 2023-04-22 2550/week @ 2023-04-29 2463/week @ 2023-05-06 2558/week @ 2023-05-13 2057/week @ 2023-05-20

10,029 downloads per month
Used in 23 crates (via zenoh-keyexpr)

EPL-2.0 license

17KB
449 lines

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.

Dependencies

~680KB
~12K SLoC