#order #ordered-set #custom #map

ds-ext

Extensions to standard Rust data structures which provide additional capabilities

11 releases

new 0.4.0 Feb 4, 2026
0.3.0 Aug 29, 2024
0.2.0 Aug 13, 2024
0.1.7 Jan 22, 2024
0.1.0 Jul 3, 2023

#1996 in Data structures

Download history 29/week @ 2025-10-14 45/week @ 2025-10-21 30/week @ 2025-10-28 27/week @ 2025-11-04 28/week @ 2025-11-11 23/week @ 2025-11-18 25/week @ 2025-11-25 28/week @ 2025-12-02 19/week @ 2025-12-09 32/week @ 2025-12-16 22/week @ 2025-12-23 21/week @ 2025-12-30 7/week @ 2026-01-06 9/week @ 2026-01-13 28/week @ 2026-01-20 27/week @ 2026-01-27

77 downloads per month
Used in 15 crates (5 directly)

Apache-2.0

86KB
2K SLoC

This crate repackages standard data structures with additional capabilities, like fast ordered maps and sets.

OrdHashSet uses a [Vec] internally for ordering. OrdHashSet and OrdHashMap both implement a bisect method which allows looking up a key by comparison, potentially avoiding the need for a heap allocation to construct a search key..

Features:

  • all: enables all features
  • serialize: enables support for serde.
  • stream: enables support for destream.
  • hash: enables support for async-hash.

Example usage:

use ds_ext::*;

let mut set = OrdHashSet::new();
assert!(set.is_empty());

set.insert(1);
assert!(set.contains(&1));
assert_eq!(set.len(), 1);

let mut map = OrdHashMap::from_iter(set.into_iter().map(|i| (i, i)));
assert_eq!(map.len(), 1);

assert_eq!(map.get(&1), map.bisect(|i| i.partial_cmp(&1)));

ds-ext

Crates.io Docs.rs

Extensions to standard Rust data structures which provide additional capabilities

Example usage:

use ds_ext::*;

let mut set = OrdHashSet::new();
set.insert(1);
assert!(set.contains(&1));

let mut map = OrdHashMap::from_iter(set.into_iter().map(|i| (i, i)));
assert_eq!(map.get(&1), map.bisect(|i| i.partial_cmp(&1)));

Dependencies

~1.2–2.2MB
~39K SLoC