#key-value #hash-map #maps #vec #pair #structure

vec_key_value_pair

A drop-in replacement for std::HashMap and std::HashSet that use Vec on the backend

2 unstable releases

0.2.0 Jun 8, 2024
0.1.0 Dec 29, 2023

#1503 in Data structures

Download history 8/week @ 2024-07-30 3/week @ 2024-08-27 1/week @ 2024-09-10 1/week @ 2024-09-17 36/week @ 2024-09-24 5/week @ 2024-10-01

96 downloads per month

Apache-2.0

58KB
2K SLoC

vec_key_value_pair

A drop in replacement for std::HashMap and std::HashSet that use Vec on the backend. Meant for small maps, where you need the key-value pair structure, but don't want to pay for the expensive hashing.

Can also be used for types that don't implement Hash

In the worst case scenario the performance of this data structure is O(n)


lib.rs:

Vec key value pair

A crate that adds drop in replacement for std::collections::HashMap and std::collections::HashSet that use linear search instead of hashing.

For extensive documentation and examples, see the original documentation, both map::VecMap and set::VecSet has identical API to std::collections::HashMap and std::collections::HashSet except for functions that interact with the hasher.

For obvious reasons neither map::VecMap not set::VecSet use a hasher.

No runtime deps