Crates.io | vecmap-rs |
lib.rs | vecmap-rs |
version | 0.2.2 |
source | src |
created_at | 2022-09-14 19:24:16.832884 |
updated_at | 2024-07-28 19:35:21.094403 |
description | A vector-based map and set implementation |
homepage | |
repository | https://github.com/martinohmann/vecmap-rs |
max_upload_size | |
id | 666015 |
size | 159,428 |
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
.
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.The source code of vecmap-rs is licensed under either of Apache License, Version 2.0 or MIT license at your option.