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
77 downloads per month
Used in 15 crates
(5 directly)
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 featuresserialize: enables support forserde.stream: enables support fordestream.hash: enables support forasync-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
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