Struct nodit::nodit::set::NoditSet

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

An ordered set of non-overlapping intervals based on NoditMap.

I is the generic type parameter for the Ord type the K type is interval over.

K is the generic type parameter for the interval implementing type in the set.

Phrasing it another way: I is the point type and K is the interval type.

See NoditMap for more details.

Implementations§

source§

impl<I, K> NoditSet<I, K>
where I: PointType, K: IntervalType<I>,

source

pub fn overlaps<Q>(&self, interval: Q) -> bool
where Q: IntervalType<I>,

See NoditMap::overlaps() for more details.

source

pub fn overlapping<Q>(&self, interval: Q) -> impl DoubleEndedIterator<Item = &K>
where Q: IntervalType<I>,

See NoditMap::overlapping() for more details.

source

pub fn get_at_point(&self, point: I) -> Result<&K, K>

See NoditMap::get_key_value_at_point() for more details.

source

pub fn contains_point(&self, point: I) -> bool

See NoditMap::contains_point() for more details.

source

pub fn remove_overlapping<'a, Q>( &'a mut self, interval: Q ) -> impl Iterator<Item = K>
where Q: IntervalType<I> + 'a,

See NoditMap::remove_overlapping() for more details.

source

pub fn cut<'a, Q>(&'a mut self, interval: Q) -> impl Iterator<Item = K>
where Q: IntervalType<I> + 'a,

See NoditMap::cut() for more details.

source

pub fn gaps_untrimmed<'a, Q>( &'a self, interval: Q ) -> impl Iterator<Item = K> + '_
where Q: IntervalType<I> + 'a,

See NoditMap::gaps_untrimmed() for more details.

source

pub fn gaps_trimmed<'a, Q>( &'a self, interval: Q ) -> impl Iterator<Item = K> + '_
where Q: IntervalType<I> + 'a,

See NoditMap::gaps_trimmed() for more details.

source

pub fn contains_interval<Q>(&self, interval: Q) -> bool
where Q: IntervalType<I>,

See NoditMap::contains_interval() for more details.

source

pub fn insert_strict(&mut self, interval: K) -> Result<(), OverlapError<()>>

See NoditMap::insert_strict() for more details.

source

pub fn insert_merge_touching( &mut self, interval: K ) -> Result<K, OverlapError<()>>

See NoditMap::insert_merge_touching() for more details.

source

pub fn insert_merge_overlapping(&mut self, interval: K) -> K

source

pub fn insert_merge_touching_or_overlapping(&mut self, interval: K) -> K

source

pub fn insert_overwrite(&mut self, interval: K) -> impl Iterator<Item = K>

See NoditMap::insert_overwrite() for more details.

source

pub fn from_slice_strict<const N: usize>( slice: [K; N] ) -> Result<NoditSet<I, K>, OverlapError<()>>

See NoditMap::from_slice_strict() for more details.

source

pub fn from_iter_strict( iter: impl Iterator<Item = K> ) -> Result<NoditSet<I, K>, OverlapError<()>>

See NoditMap::from_iter_strict() for more details.

source§

impl<I, K> NoditSet<I, K>

source

pub fn new() -> Self

See NoditMap::new() for more details.

source

pub fn len(&self) -> usize

See NoditMap::len() for more details.

source

pub fn is_empty(&self) -> bool

See NoditMap::is_empty() for more details.

source

pub fn iter(&self) -> impl DoubleEndedIterator<Item = &K>

See NoditMap::iter() for more details.

source

pub fn first(&self) -> Option<&K>

See NoditMap::first_key_value() for more details.

source

pub fn last(&self) -> Option<&K>

See NoditMap::last_key_value() for more details.

Trait Implementations§

source§

impl<I: Clone, K: Clone> Clone for NoditSet<I, K>

source§

fn clone(&self) -> NoditSet<I, K>

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<I: Debug, K: Debug> Debug for NoditSet<I, K>

source§

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

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

impl<I, K> Default for NoditSet<I, K>
where I: PointType,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<I, K> IntoIterator for NoditSet<I, K>

§

type Item = K

The type of the elements being iterated over.
§

type IntoIter = IntoIter<I, K>

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<I: PartialEq, K: PartialEq> PartialEq for NoditSet<I, K>

source§

fn eq(&self, other: &NoditSet<I, K>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<I: Eq, K: Eq> Eq for NoditSet<I, K>

source§

impl<I, K> StructuralPartialEq for NoditSet<I, K>

Auto Trait Implementations§

§

impl<I, K> Freeze for NoditSet<I, K>

§

impl<I, K> RefUnwindSafe for NoditSet<I, K>

§

impl<I, K> Send for NoditSet<I, K>
where I: Send, K: Send,

§

impl<I, K> Sync for NoditSet<I, K>
where I: Sync, K: Sync,

§

impl<I, K> Unpin for NoditSet<I, K>
where I: Unpin,

§

impl<I, K> UnwindSafe for NoditSet<I, K>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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 T
where 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.