3 unstable releases

Uses new Rust 2024

0.3.0 Apr 23, 2026
0.2.1 Apr 24, 2026
0.2.0 May 7, 2024
0.1.0 Jun 11, 2020

#237 in Data structures

Download history 10049/week @ 2026-02-19 13323/week @ 2026-02-26 15654/week @ 2026-03-05 13280/week @ 2026-03-12 15273/week @ 2026-03-19 15497/week @ 2026-03-26 11688/week @ 2026-04-02 11618/week @ 2026-04-09 13647/week @ 2026-04-16 14548/week @ 2026-04-23 17500/week @ 2026-04-30 12225/week @ 2026-05-07 19039/week @ 2026-05-14 15955/week @ 2026-05-21 15600/week @ 2026-05-28 24557/week @ 2026-06-04

77,857 downloads per month
Used in 27 crates (7 directly)

MIT/Apache

76KB
2K SLoC

sorted_vector_map

sorted_vector_map is an implementation of an ordered map and set (like std::collections::BTreeMap and std::collections::BTreeSet) using a sorted vector as the backing store.

Sorted vector maps are appropriate when data is frequently loaded from an ordered source, queried a small number of times, and infrequently modified through insertion or removal.

Loading from an ordered sequence is O(n) through an optimization to insert that handles in-order insertions specially. Extension of the sequence is also optimized, where extending a map or set of size n with m elements in a single operation is O(n + m log m). Otherwise, loading from an unordered sequence is O(n^2).

Look-up is O(log n) through binary search. Insertion and removal are both O(n), as are set operations like intersection, union and difference.

sorted_vector_map is part of rust-shed. See the rust-shed repository for more documentation, including the contributing guide.

License

sorted_vector_map is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.

Dependencies

~1–2.3MB
~42K SLoC