#vector #map #set #vec #no-std

no-std vecmap-rs

A vector-based map and set implementation

9 releases

Uses new Rust 2021

0.1.8 Oct 30, 2022
0.1.7 Oct 11, 2022
0.1.5 Sep 21, 2022

#519 in Data structures

Download history 132/week @ 2022-09-14 89/week @ 2022-09-21 120/week @ 2022-09-28 105/week @ 2022-10-05 206/week @ 2022-10-12 226/week @ 2022-10-19 237/week @ 2022-10-26 120/week @ 2022-11-02 96/week @ 2022-11-09 70/week @ 2022-11-16

553 downloads per month
Used in 5 crates (via hcl-rs)

MIT/Apache

115KB
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