Struct rangemap::RangeMap [−][src]
pub struct RangeMap<K, V> { /* fields omitted */ }Expand description
A map whose keys are stored as (half-open) ranges bounded
inclusively below and exclusively above (start..end).
Contiguous and overlapping ranges that map to the same value are coalesced into a single range.
Implementations
Returns a reference to the value corresponding to the given key, if the key is covered by any range in the map.
Returns the range-value pair (as a pair of references) corresponding to the given key, if the key is covered by any range in the map.
Returns true if any range in the map covers the specified key.
Gets an iterator over all pairs of key range and value, ordered by key range.
The iterator element type is (&'a Range<K>, &'a V).
Insert a pair of key range and value into the map.
If the inserted range partially or completely overlaps any existing range in the map, then the existing range (or ranges) will be partially or completely replaced by the inserted range.
If the inserted range either overlaps or is immediately adjacent any existing range mapping to the same value, then the ranges will be coalesced into a single contiguous range.
Panics
Panics if range start >= end.
Removes a range from the map, if all or any of it was present.
If the range to be removed partially overlaps any ranges in the map, then those ranges will be contracted to no longer cover the removed range.
Panics
Panics if range start >= end.
Gets an iterator over all the maximally-sized ranges
contained in outer_range that are not covered by
any range stored in the map.
The iterator element type is Range<K>.
NOTE: Calling gaps eagerly finds the first gap,
even if the iterator is never consumed.
Trait Implementations
Extends a collection with the contents of an iterator. Read more
extend_one)Extends a collection with exactly one element.
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
Auto Trait Implementations
impl<K, V> RefUnwindSafe for RangeMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> UnwindSafe for RangeMap<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more