pub struct IntervalMap<V> { /* private fields */ }Implementations§
Source§impl<V: Clone> IntervalMap<V>
Maps from non-overlapping Intervals to V.
 
impl<V: Clone> IntervalMap<V>
Maps from non-overlapping Intervals to V.
pub fn new() -> IntervalMap<V>
Sourcepub fn keys(&self) -> KeyIter<'_, V> ⓘ
 
pub fn keys(&self) -> KeyIter<'_, V> ⓘ
Returns iterator over all intervals keys, in sorted order.
Sourcepub fn iter(&self) -> ItemIter<'_, V> ⓘ
 
pub fn iter(&self) -> ItemIter<'_, V> ⓘ
Returns iterator over all intervals keys and their values, in order by interval key.
Sourcepub fn iter_from(&self, begin: usize) -> ItemIter<'_, V> ⓘ
 
pub fn iter_from(&self, begin: usize) -> ItemIter<'_, V> ⓘ
Returns iterator over all interval keys and their values, starting with the first interval
containing or after begin.
Sourcepub fn clear(&mut self, interval: Interval) -> Vec<Mutation<V>>
 
pub fn clear(&mut self, interval: Interval) -> Vec<Mutation<V>>
Mutates the map so that the given range maps to nothing, modifying and removing intervals as needed. Returns what mutations were performed, including the values of any completely-removed intervals. If an interval is split (e.g. by inserting [5,6] into [0,10]), its value will be cloned.
Returned mutations are ordered by their original interval values.
Sourcepub fn insert(&mut self, interval: Interval, val: V) -> Vec<Mutation<V>>
 
pub fn insert(&mut self, interval: Interval, val: V) -> Vec<Mutation<V>>
Insert range from start to end, inclusive, mapping that range to val.  Existing
contents of that range are cleared, and mutations returned, as for clear.
pub fn get(&self, x: usize) -> Option<(Interval, &V)>
pub fn get_mut(&mut self, x: usize) -> Option<(Interval, &mut V)>
Trait Implementations§
Source§impl<V: Clone> Clone for IntervalMap<V>
 
impl<V: Clone> Clone for IntervalMap<V>
Source§fn clone(&self) -> IntervalMap<V>
 
fn clone(&self) -> IntervalMap<V>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<V: Debug> Debug for IntervalMap<V>
 
impl<V: Debug> Debug for IntervalMap<V>
Auto Trait Implementations§
impl<V> Freeze for IntervalMap<V>
impl<V> RefUnwindSafe for IntervalMap<V>where
    V: RefUnwindSafe,
impl<V> Send for IntervalMap<V>where
    V: Send,
impl<V> Sync for IntervalMap<V>where
    V: Sync,
impl<V> Unpin for IntervalMap<V>where
    V: Unpin,
impl<V> UnwindSafe for IntervalMap<V>where
    V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more