pub struct RangeMultiMap<K, S, C: Storage<Item<AnyRange<K>, S>>> { /* private fields */ }Expand description
Multi map.
In a multi map, each key is associated to a set of values.
The type parameter S is the set type. It can be replaced by anything
implementing the cc_traits::SetMut trait, such as the standard
BTreeSet and HashSet.
Implementations§
Source§impl<K, S, C: Storage<Item<AnyRange<K>, S>>> RangeMultiMap<K, S, C>
impl<K, S, C: Storage<Item<AnyRange<K>, S>>> RangeMultiMap<K, S, C>
pub fn new() -> RangeMultiMap<K, S, C>
Source§impl<K, S, C: Storage<Item<AnyRange<K>, S>>> RangeMultiMap<K, S, C>
impl<K, S, C: Storage<Item<AnyRange<K>, S>>> RangeMultiMap<K, S, C>
Sourcepub fn insert<R: AsRange<Item = K>, V>(&mut self, key: R, value: V)
pub fn insert<R: AsRange<Item = K>, V>(&mut self, key: R, value: V)
§Complexity
O((k + 1) log n + |S|), where n is the number of ranges in the map,
k is the number of existing ranges that overlap, or are connected
to, key (see RangeMap::update), and |S| is the size of the
value set attached to the affected range, which is cloned and mutated
by this operation.
Sourcepub fn remove<R: AsRange<Item = K>, V>(&mut self, key: R, value: &V)
pub fn remove<R: AsRange<Item = K>, V>(&mut self, key: R, value: &V)
§Complexity
O((k + 1) log n + |S|), where n is the number of ranges in the map,
k is the number of existing ranges that overlap, or are connected
to, key (see RangeMap::update), and |S| is the size of the
value set attached to the affected range, which is cloned and mutated
by this operation.