#hash-map #hash-set #projection #key #indexing #keyed

keyed-set

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

10 releases (1 stable)

1.0.0 Mar 5, 2024
0.4.5 Mar 29, 2023
0.4.4 Dec 21, 2022
0.4.2 Nov 14, 2022
0.1.0 Nov 8, 2022

#152 in Data structures

Download history 8783/week @ 2024-06-10 9357/week @ 2024-06-17 10017/week @ 2024-06-24 8648/week @ 2024-07-01 9105/week @ 2024-07-08 8372/week @ 2024-07-15 9330/week @ 2024-07-22 8726/week @ 2024-07-29 9608/week @ 2024-08-05 8261/week @ 2024-08-12 8693/week @ 2024-08-19 11600/week @ 2024-08-26 9955/week @ 2024-09-02 11319/week @ 2024-09-09 13143/week @ 2024-09-16 10213/week @ 2024-09-23

44,944 downloads per month
Used in 65 crates (via zenoh-keyexpr)

EPL-2.0 license

21KB
451 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.


lib.rs:

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

~2MB
~25K SLoC