Struct range_bounds_map::range_bounds_set::RangeBoundsSet
source · 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>
impl<I, K> RangeBoundsSet<I, K>
sourcepub fn new() -> Self
pub fn new() -> Self
See RangeBoundsMap::new()
for more details.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
See RangeBoundsMap::len()
for more details.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
See RangeBoundsMap::is_empty()
for more details.
sourcepub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: NiceRange<I>,
pub fn overlaps<Q>(&self, range: Q) -> boolwhere
Q: NiceRange<I>,
See RangeBoundsMap::overlaps()
for more details.
sourcepub fn overlapping<Q>(&self, range: Q) -> impl DoubleEndedIterator<Item = &K>where
Q: NiceRange<I>,
pub fn overlapping<Q>(&self, range: Q) -> impl DoubleEndedIterator<Item = &K>where
Q: NiceRange<I>,
See RangeBoundsMap::overlapping()
for more details.
sourcepub fn get_at_point(&self, point: I) -> Result<K, (Bound<I>, Bound<I>)>
pub fn get_at_point(&self, point: I) -> Result<K, (Bound<I>, Bound<I>)>
See RangeBoundsMap::get_entry_at_point()
for more details.
sourcepub fn contains_point(&self, point: I) -> bool
pub fn contains_point(&self, point: I) -> bool
See RangeBoundsMap::contains_point()
for more details.
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &K>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &K>
See RangeBoundsMap::iter()
for more details.
sourcepub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = K> + '_where
Q: NiceRange<I> + 'a,
pub fn remove_overlapping<'a, Q>(
&'a mut self,
range: Q
) -> impl Iterator<Item = K> + '_where
Q: NiceRange<I> + 'a,
See RangeBoundsMap::remove_overlapping()
for more details.
sourcepub 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>,
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.
sourcepub fn gaps<'a, Q>(
&'a self,
range: Q
) -> impl DoubleEndedIterator<Item = (Bound<I>, Bound<I>)> + '_where
Q: NiceRange<I> + 'a,
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.
sourcepub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: NiceRange<I>,
pub fn contains_range<Q>(&self, range: Q) -> boolwhere
Q: NiceRange<I>,
See RangeBoundsMap::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 RangeBoundsMap::insert_strict()
for more details.
sourcepub fn insert_merge_touching(
&mut self,
range: K
) -> Result<K, OverlapOrTryFromBoundsError>where
K: TryFromBounds<I>,
pub fn insert_merge_touching(
&mut self,
range: K
) -> Result<K, OverlapOrTryFromBoundsError>where
K: TryFromBounds<I>,
See RangeBoundsMap::insert_merge_touching()
for more details.
sourcepub fn insert_merge_overlapping(
&mut self,
range: K
) -> Result<K, TryFromBoundsError>where
K: TryFromBounds<I>,
pub fn insert_merge_overlapping(
&mut self,
range: K
) -> Result<K, TryFromBoundsError>where
K: TryFromBounds<I>,
See RangeBoundsMap::insert_merge_overlapping()
for more details.
sourcepub fn insert_merge_touching_or_overlapping(
&mut self,
range: K
) -> Result<K, TryFromBoundsError>where
K: TryFromBounds<I>,
pub fn insert_merge_touching_or_overlapping(
&mut self,
range: K
) -> Result<K, TryFromBoundsError>where
K: TryFromBounds<I>,
See RangeBoundsMap::insert_merge_touching_or_overlapping()
for more details.
sourcepub fn insert_overwrite(&mut self, range: K) -> Result<(), TryFromBoundsError>where
K: TryFromBounds<I>,
pub fn insert_overwrite(&mut self, range: K) -> Result<(), TryFromBoundsError>where
K: TryFromBounds<I>,
See RangeBoundsMap::insert_overwrite()
for more details.
sourcepub fn first(&self) -> Option<&K>
pub fn first(&self) -> Option<&K>
See RangeBoundsMap::first_entry()
for more details.
sourcepub fn last(&self) -> Option<&K>
pub fn last(&self) -> Option<&K>
See RangeBoundsMap::last_entry()
for more details.
sourcepub fn from_slice_strict<const N: usize>(
slice: [K; N]
) -> Result<RangeBoundsSet<I, K>, OverlapError>
pub fn from_slice_strict<const N: usize>( slice: [K; N] ) -> Result<RangeBoundsSet<I, K>, OverlapError>
See RangeBoundsMap::from_slice_strict()
for more details.
Trait Implementations§
source§impl<I: Clone, K: Clone> Clone for RangeBoundsSet<I, K>
impl<I: Clone, K: Clone> Clone for RangeBoundsSet<I, K>
source§fn clone(&self) -> RangeBoundsSet<I, K>
fn clone(&self) -> RangeBoundsSet<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 RangeBoundsSet<I, K>where
I: PartialOrd,
impl<I, K> Default for RangeBoundsSet<I, K>where
I: PartialOrd,
source§impl<'de, I, K> Deserialize<'de> for RangeBoundsSet<I, K>
impl<'de, I, K> Deserialize<'de> for RangeBoundsSet<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 RangeBoundsSet<I, K>
impl<I, K> IntoIterator for RangeBoundsSet<I, K>
source§impl<I: PartialEq, K: PartialEq> PartialEq for RangeBoundsSet<I, K>
impl<I: PartialEq, K: PartialEq> PartialEq for RangeBoundsSet<I, K>
source§fn eq(&self, other: &RangeBoundsSet<I, K>) -> bool
fn eq(&self, other: &RangeBoundsSet<I, K>) -> bool
self
and other
values to be equal, and is used
by ==
.