pub struct DiscreteRangeSet<I, K> { /* private fields */ }Expand description
An ordered set of non-overlapping ranges based on DiscreteRangeMap.
I is the generic type parameter for the Ord type the K
type is range over.
K is the generic type parameter for the range implementing type
in the set.
Phrasing it another way: I is the point type and K is the range type.
See DiscreteRangeMap for more details.
Implementations§
source§impl<I, K> DiscreteRangeSet<I, K>
impl<I, K> DiscreteRangeSet<I, K>
sourcepub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
pub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
See DiscreteRangeMap::overlaps() for more details.
sourcepub fn overlapping<Q>(&self, range: Q) -> impl DoubleEndedIterator<Item = &K>where
Q: RangeType<I>,
pub fn overlapping<Q>(&self, range: Q) -> impl DoubleEndedIterator<Item = &K>where
Q: RangeType<I>,
See DiscreteRangeMap::overlapping() for more details.
sourcepub fn get_at_point(&self, point: I) -> Result<&K, K>
pub fn get_at_point(&self, point: I) -> Result<&K, K>
See DiscreteRangeMap::get_entry_at_point() for more details.
sourcepub fn contains_point(&self, point: I) -> bool
pub fn contains_point(&self, point: I) -> bool
See DiscreteRangeMap::contains_point() for more details.
sourcepub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
pub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
See DiscreteRangeMap::remove_overlapping() for more details.
sourcepub fn cut<'a, Q>(&'a mut self, range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
pub fn cut<'a, Q>(&'a mut self, range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
See DiscreteRangeMap::cut() for more details.
sourcepub fn gaps<'a, Q>(&'a self, range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
pub fn gaps<'a, Q>(&'a self, range: Q) -> impl Iterator<Item = K> + '_where
Q: RangeType<I> + 'a,
See DiscreteRangeMap::gaps() for more details.
sourcepub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
pub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: RangeType<I>,
See DiscreteRangeMap::contains_range() for more details.
sourcepub fn insert_strict(&mut self, range: K) -> Result<(), OverlapError>
pub fn insert_strict(&mut self, range: K) -> Result<(), OverlapError>
See DiscreteRangeMap::insert_strict() for more details.
sourcepub fn insert_merge_touching(&mut self, range: K) -> Result<K, OverlapError>
pub fn insert_merge_touching(&mut self, range: K) -> Result<K, OverlapError>
See DiscreteRangeMap::insert_merge_touching() for more details.
sourcepub fn insert_merge_overlapping(&mut self, range: K) -> K
pub fn insert_merge_overlapping(&mut self, range: K) -> K
See DiscreteRangeMap::insert_merge_overlapping() for more details.
sourcepub fn insert_merge_touching_or_overlapping(&mut self, range: K) -> K
pub fn insert_merge_touching_or_overlapping(&mut self, range: K) -> K
See DiscreteRangeMap::insert_merge_touching_or_overlapping() for more details.
sourcepub fn insert_overwrite(&mut self, range: K)
pub fn insert_overwrite(&mut self, range: K)
See DiscreteRangeMap::insert_overwrite() for more details.
sourcepub fn from_slice_strict<const N: usize>(
slice: [K; N]
) -> Result<DiscreteRangeSet<I, K>, OverlapError>
pub fn from_slice_strict<const N: usize>( slice: [K; N] ) -> Result<DiscreteRangeSet<I, K>, OverlapError>
See DiscreteRangeMap::from_slice_strict() for more details.
sourcepub fn from_iter_strict(
iter: impl Iterator<Item = K>
) -> Result<DiscreteRangeSet<I, K>, OverlapError>
pub fn from_iter_strict( iter: impl Iterator<Item = K> ) -> Result<DiscreteRangeSet<I, K>, OverlapError>
See DiscreteRangeMap::from_iter_strict() for more details.
source§impl<I, K> DiscreteRangeSet<I, K>
impl<I, K> DiscreteRangeSet<I, K>
sourcepub fn new() -> Self
pub fn new() -> Self
See DiscreteRangeMap::new() for more details.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
See DiscreteRangeMap::len() for more details.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
See DiscreteRangeMap::is_empty() for more details.
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &K>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &K>
See DiscreteRangeMap::iter() for more details.
sourcepub fn first(&self) -> Option<&K>
pub fn first(&self) -> Option<&K>
See DiscreteRangeMap::first_entry() for more details.
sourcepub fn last(&self) -> Option<&K>
pub fn last(&self) -> Option<&K>
See DiscreteRangeMap::last_entry() for more details.
Trait Implementations§
source§impl<I: Clone, K: Clone> Clone for DiscreteRangeSet<I, K>
impl<I: Clone, K: Clone> Clone for DiscreteRangeSet<I, K>
source§fn clone(&self) -> DiscreteRangeSet<I, K>
fn clone(&self) -> DiscreteRangeSet<I, K>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<I, K> Default for DiscreteRangeSet<I, K>where
I: PointType,
impl<I, K> Default for DiscreteRangeSet<I, K>where
I: PointType,
source§impl<'de, I, K> Deserialize<'de> for DiscreteRangeSet<I, K>
impl<'de, I, K> Deserialize<'de> for DiscreteRangeSet<I, K>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl<I, K> IntoIterator for DiscreteRangeSet<I, K>
impl<I, K> IntoIterator for DiscreteRangeSet<I, K>
source§impl<I: PartialEq, K: PartialEq> PartialEq for DiscreteRangeSet<I, K>
impl<I: PartialEq, K: PartialEq> PartialEq for DiscreteRangeSet<I, K>
source§fn eq(&self, other: &DiscreteRangeSet<I, K>) -> bool
fn eq(&self, other: &DiscreteRangeSet<I, K>) -> bool
self and other values to be equal, and is used
by ==.