Struct nekolib::ds::IntervalMap

source ·
pub struct IntervalMap<K, V> { /* private fields */ }
Expand description

区間から値への対応づけ。

Examples

todo!()

Implementations§

source§

impl<K: Ord + Clone, V: Eq + Clone> IntervalMap<K, V>

source

pub fn new() -> Self

$S\gets\emptyset$ で初期化する。

source

pub fn is_empty(&self) -> bool

$S=\emptyset$ を返す。

source

pub fn insert<B: RangeBounds<K>>(&mut self, b: B, v: V)

区間 b 中の各 $k$ に対して $S\xleftarrow{\cup} (k\mapsto v)$ で更新する。

source

pub fn remove<B: RangeBounds<K>>(&mut self, b: B) -> Vec<(Interval<K>, V)>

区間 b 中の各 $k$ に対して $S\xleftarrow{\setminus} (k\mapsto\bullet)$ で更新する。

source

pub fn superset_of<B: RangeBounds<K>>(&self, b: B) -> Option<(&Interval<K>, &V)>

$T\subseteq S$ かつ b を含む $T$ があれば、その $T$ および対応する値を返す。

source

pub fn iter( &self ) -> impl Iterator<Item = (&Interval<K>, &V)> + DoubleEndedIterator + '_

Trait Implementations§

source§

impl<K: Clone, V: Clone> Clone for IntervalMap<K, V>

source§

fn clone(&self) -> IntervalMap<K, V>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K: Ord + Debug, V: Debug> Debug for IntervalMap<K, V>

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, K: Ord, V: Eq> IntoIterator for &'a IntervalMap<K, V>

§

type Item = (&'a Interval<K>, &'a V)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, Interval<K>, V>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<K: Ord, V: Eq> IntoIterator for IntervalMap<K, V>

§

type Item = (Interval<K>, V)

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Interval<K>, V, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for IntervalMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V> Send for IntervalMap<K, V>where K: Send, V: Send,

§

impl<K, V> Sync for IntervalMap<K, V>where K: Sync, V: Sync,

§

impl<K, V> Unpin for IntervalMap<K, V>

§

impl<K, V> UnwindSafe for IntervalMap<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V