Skip to main content

OrderedBTreeMultiMap

Type Alias OrderedBTreeMultiMap 

Source
pub type OrderedBTreeMultiMap<K, V> = BTreeMultiMap<K, V, Vec<OrdMultiPair<K, V>>, OrdMultiPair<K, V>>;
Expand description

A multimap whose entries are ordered by key and then value.

This representation requires V: Ord, and lets exact pair removal locate the value directly instead of scanning entries that share the same key. Removal remains O(log n); the ordered representation avoids a linear scan over values that share a key, rather than making removal O(1).

use indexset::concurrent::multimap::OrderedBTreeMultiMap;

let map = OrderedBTreeMultiMap::<usize, &str>::new();
map.insert(1, "b");
map.insert(1, "a");

assert_eq!(map.remove(&1, &"b"), Some((1, "b")));

Aliased Typeยง

pub struct OrderedBTreeMultiMap<K, V> { /* private fields */ }