19 releases

0.2.2 Jul 28, 2024
0.2.1 Jan 3, 2024
0.2.0 Dec 25, 2023
0.1.12 Sep 19, 2023
0.1.8 Oct 30, 2022

#204 in Data structures

Download history 3921/week @ 2024-07-27 2187/week @ 2024-08-03 2788/week @ 2024-08-10 2939/week @ 2024-08-17 2764/week @ 2024-08-24 2286/week @ 2024-08-31 2479/week @ 2024-09-07 2292/week @ 2024-09-14 2153/week @ 2024-09-21 3175/week @ 2024-09-28 2005/week @ 2024-10-05 2352/week @ 2024-10-12 2610/week @ 2024-10-19 2703/week @ 2024-10-26 3017/week @ 2024-11-02 2726/week @ 2024-11-09

11,575 downloads per month
Used in 55 crates (5 directly)

MIT/Apache

140KB
2K SLoC

vecmap-rs

Build Status crates.io docs.rs License: Apache 2.0 License: MIT

A vector-based ordered map and set implementation with zero dependencies and support for #![no_std].

Map keys are not required to be hashable and do not need to form a total order. Therefore, VecMap<K, V> and VecSet<T> can be used with key types which neither implement Hash nor Ord.

Since vecmap-rs is a Vec<(K, V)> under the hood, worst case lookup and insertion performance is O(n) and scales with the number of map entries. Thus, its main use case are small collections with unhashable keys.

For key types that implement Hash and Ord consider using a map or set implementation with better performance such as HashMap/HashSet and BTreeMap/BTreeSet from the standard library or popular alternatives like IndexMap/IndexSet.

Cargo features

The following features are available:

  • serde: Provides Serialize and Deserialize implementations for VecMap and VecSet. This feature is disabled by default. Enabling it will pull in serde as a dependency.

License

The source code of vecmap-rs is licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~165KB