#insert #tree-set

stable_bst

An ordered map and set based on a binary search tree. Works with stable Rust 1.9.0.

4 releases (2 breaking)

Uses old Rust 2015

0.2.0 Aug 19, 2016
0.1.0 Jul 9, 2016
0.0.2 Jul 7, 2016
0.0.1 Jul 7, 2016

#1394 in Data structures

Download history 899/week @ 2024-12-19 170/week @ 2024-12-26 1801/week @ 2025-01-02 1004/week @ 2025-01-09 2400/week @ 2025-01-16 3540/week @ 2025-01-23 4579/week @ 2025-01-30 2260/week @ 2025-02-06 3327/week @ 2025-02-13 1805/week @ 2025-02-20 2502/week @ 2025-02-27 2912/week @ 2025-03-06 2237/week @ 2025-03-13 4682/week @ 2025-03-20 5273/week @ 2025-03-27 5720/week @ 2025-04-03

18,261 downloads per month
Used in 6 crates (via rustfst)

MIT/Apache

270KB
2.5K SLoC

Maps are collections of unique keys with corresponding values, and sets are just unique keys without a corresponding value.

This crate defines the TreeMap and TreeSet types. Their keys must implement Ord.

TreeMaps are ordered.

Examples

use stable_bst::TreeSet;

let mut tree_set = TreeSet::new();

tree_set.insert(2);
tree_set.insert(1);
tree_set.insert(3);

for i in tree_set.iter() {
   println!("{}", i) // prints 1, then 2, then 3
}

An ordered map and set based on a binary search tree.

Forked from https://github.com/contain-rs/bst and updated to work with stable Rust (1.9.0).

Documentation here; crate here.

Dependencies