1 unstable release

0.1.0 Jun 11, 2020

#1518 in Data structures

Download history 8373/week @ 2023-06-01 11283/week @ 2023-06-08 9122/week @ 2023-06-15 9600/week @ 2023-06-22 5644/week @ 2023-06-29 9248/week @ 2023-07-06 9080/week @ 2023-07-13 10384/week @ 2023-07-20 11628/week @ 2023-07-27 10639/week @ 2023-08-03 10497/week @ 2023-08-10 11436/week @ 2023-08-17 19819/week @ 2023-08-24 11183/week @ 2023-08-31 10076/week @ 2023-09-07 5353/week @ 2023-09-14

49,109 downloads per month
Used in 10 crates (5 directly)


1.5K SLoC


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.


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