pub struct IntervalMap<K, V> { /* private fields */ }Expand description
Implementations§
Source§impl<K, V> IntervalMap<K, V>
impl<K, V> IntervalMap<K, V>
Sourcepub fn new() -> IntervalMap<K, V>
pub fn new() -> IntervalMap<K, V>
$S\gets\emptyset$ で初期化する。
pub fn len(&self) -> usize
Sourcepub fn insert<B>(&mut self, b: B, v: V)where
B: RangeBounds<K>,
pub fn insert<B>(&mut self, b: B, v: V)where
B: RangeBounds<K>,
区間 b 中の各 $k$ に対して $S\xleftarrow{\cup} (k\mapsto v)$ で更新する。
Sourcepub fn remove<B>(&mut self, b: B) -> Vec<(Interval<K>, V)>where
B: RangeBounds<K>,
pub fn remove<B>(&mut self, b: B) -> Vec<(Interval<K>, V)>where
B: RangeBounds<K>,
区間 b 中の各 $k$ に対して $S\xleftarrow{\setminus} (k\mapsto\bullet)$
で更新する。
Sourcepub fn superset_of<B>(&self, b: B) -> Option<(&Interval<K>, &V)>where
B: RangeBounds<K>,
pub fn superset_of<B>(&self, b: B) -> Option<(&Interval<K>, &V)>where
B: RangeBounds<K>,
$T\subseteq S$ かつ b を含む $T$ があれば、その $T$
および対応する値を返す。
pub fn iter( &self, ) -> impl Iterator<Item = (&Interval<K>, &V)> + DoubleEndedIterator
Trait Implementations§
Source§impl<K, V> Clone for IntervalMap<K, V>
impl<K, V> Clone for IntervalMap<K, V>
Source§fn clone(&self) -> IntervalMap<K, V>
fn clone(&self) -> IntervalMap<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V> Debug for IntervalMap<K, V>
impl<K, V> Debug for IntervalMap<K, V>
Source§impl<'a, K, V> IntoIterator for &'a IntervalMap<K, V>
impl<'a, K, V> IntoIterator for &'a IntervalMap<K, V>
Source§fn into_iter(self) -> <&'a IntervalMap<K, V> as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a IntervalMap<K, V> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl<K, V> IntoIterator for IntervalMap<K, V>
impl<K, V> IntoIterator for IntervalMap<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for IntervalMap<K, V>
impl<K, V> RefUnwindSafe for IntervalMap<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, V> Send for IntervalMap<K, V>
impl<K, V> Sync for IntervalMap<K, V>
impl<K, V> Unpin for IntervalMap<K, V>
impl<K, V> UnwindSafe for IntervalMap<K, V>where
V: RefUnwindSafe,
K: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more