Thanks to visit codestin.com
Credit goes to lib.rs

#hash-map #hash-set

keyed-set

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

11 releases (2 stable)

1.1.0 Sep 3, 2025
1.0.0 Mar 5, 2024
0.4.5 Mar 29, 2023
0.4.4 Dec 21, 2022
0.1.0 Nov 8, 2022

#494 in Data structures

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

95,014 downloads per month
Used in 108 crates (via zenoh-keyexpr)

EPL-2.0 OR Apache-2.0

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.

Dependencies

~2MB
~27K SLoC