wabi_tree 0.1.2

Order-statistic B-tree map and set with O(log n) rank operations. Drop-in replacements for BTreeMap/BTreeSet.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// A zero-based rank into the sorted order of a map or set.
///
/// This is an order-statistic extension and is not part of the standard
/// `BTreeMap` or `BTreeSet` APIs.
///
/// # Examples
///
/// ```
/// use wabi_tree::{OSBTreeMap, Rank};
///
/// let mut map = OSBTreeMap::new();
/// map.insert("a", 10);
/// map.insert("b", 20);
///
/// assert_eq!(map[Rank(0)], 10);
/// ```
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct Rank(pub usize);