pub struct RangeBoundsSet<I, K> { /* private fields */ }
Expand description

An ordered set of non-overlapping ranges based on RangeBoundsMap.

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

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

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

See RangeBoundsMap for more details.

Implementations§

source§

impl<I, K> RangeBoundsSet<I, K>
where I: Ord + Copy, K: NiceRange<I>,

source

pub fn new() -> Self

See RangeBoundsMap::new() for more details.

source

pub fn len(&self) -> usize

See RangeBoundsMap::len() for more details.

source

pub fn is_empty(&self) -> bool

See RangeBoundsMap::is_empty() for more details.

source

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

See RangeBoundsMap::overlaps() for more details.

source

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

See RangeBoundsMap::overlapping() for more details.

source

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

source

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

See RangeBoundsMap::contains_point() for more details.

source

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

See RangeBoundsMap::iter() for more details.

source

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

source

pub fn cut<'a, Q>( &'a mut self, range: Q ) -> Result<impl Iterator<Item = (Bound<I>, Bound<I>)> + '_, TryFromBoundsError>
where Q: NiceRange<I> + 'a, K: TryFromBounds<I>,

See RangeBoundsMap::cut() for more details.

source

pub fn gaps<'a, Q>( &'a self, range: Q ) -> impl DoubleEndedIterator<Item = (Bound<I>, Bound<I>)> + '_
where Q: NiceRange<I> + 'a,

See RangeBoundsMap::gaps() for more details.

source

pub fn contains_range<Q>(&self, range: Q) -> bool
where Q: NiceRange<I>,

See RangeBoundsMap::contains_range() for more details.

source

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

See RangeBoundsMap::insert_strict() for more details.

source

pub fn insert_merge_touching( &mut self, range: K ) -> Result<K, OverlapOrTryFromBoundsError>
where K: TryFromBounds<I>,

source

pub fn insert_merge_overlapping( &mut self, range: K ) -> Result<K, TryFromBoundsError>
where K: TryFromBounds<I>,

source

pub fn insert_merge_touching_or_overlapping( &mut self, range: K ) -> Result<K, TryFromBoundsError>
where K: TryFromBounds<I>,

source

pub fn insert_overwrite(&mut self, range: K) -> Result<(), TryFromBoundsError>
where K: TryFromBounds<I>,

See RangeBoundsMap::insert_overwrite() for more details.

source

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

See RangeBoundsMap::first_entry() for more details.

source

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

See RangeBoundsMap::last_entry() for more details.

source

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

Trait Implementations§

source§

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

source§

fn clone(&self) -> RangeBoundsSet<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 RangeBoundsSet<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 RangeBoundsSet<I, K>
where I: PartialOrd,

source§

fn default() -> Self

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

impl<'de, I, K> Deserialize<'de> for RangeBoundsSet<I, K>
where I: Ord + Copy, K: NiceRange<I> + Deserialize<'de>,

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<I, K> IntoIterator for RangeBoundsSet<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 RangeBoundsSet<I, K>

source§

fn eq(&self, other: &RangeBoundsSet<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, K> Serialize for RangeBoundsSet<I, K>
where I: Ord + Copy, K: NiceRange<I> + Serialize,

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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

source§

impl<I, K> StructuralEq for RangeBoundsSet<I, K>

source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<I, K> UnwindSafe for RangeBoundsSet<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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,