pub struct RangeSet<T, C> { /* private fields */ }Expand description
Range set.
This is based on a range map, where the values are ().
Implementations§
Source§impl<T, C> RangeSet<T, C>
impl<T, C> RangeSet<T, C>
pub fn range_count(&self) -> usize
pub fn len(&self) -> T::Len
pub fn bounded_len(&self) -> Option<T::Len>where
T: Measure + PartialEnum,
pub fn is_empty(&self) -> boolwhere
T: Measure + PartialEnum,
pub fn intersects<R: AsRange<Item = T>>(&self, values: R) -> bool
pub fn contains(&self, value: T) -> bool
pub fn iter(&self) -> Iter<'_, T, C> ⓘ
Trait Implementations§
Source§impl<R: IntoRange, C> Extend<R> for RangeSet<R::Item, C>where
R::Item: Clone + Measure + PartialOrd,
C: SimpleCollectionRef + SimpleCollectionMut + SlabMut<Node<AnyRange<R::Item>, ()>>,
impl<R: IntoRange, C> Extend<R> for RangeSet<R::Item, C>where
R::Item: Clone + Measure + PartialOrd,
C: SimpleCollectionRef + SimpleCollectionMut + SlabMut<Node<AnyRange<R::Item>, ()>>,
Source§fn extend<I: IntoIterator<Item = R>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = R>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<R: IntoRange, C> FromIterator<R> for RangeSet<R::Item, C>where
R::Item: Clone + Measure + PartialOrd,
C: SimpleCollectionRef + SimpleCollectionMut + Default + SlabMut<Node<AnyRange<R::Item>, ()>>,
impl<R: IntoRange, C> FromIterator<R> for RangeSet<R::Item, C>where
R::Item: Clone + Measure + PartialOrd,
C: SimpleCollectionRef + SimpleCollectionMut + Default + SlabMut<Node<AnyRange<R::Item>, ()>>,
Source§fn from_iter<I: IntoIterator<Item = R>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = R>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<'a, T, C> IntoIterator for &'a RangeSet<T, C>
impl<'a, T, C> IntoIterator for &'a RangeSet<T, C>
Source§impl<T, C> IntoIterator for RangeSet<T, C>
impl<T, C> IntoIterator for RangeSet<T, C>
Source§impl<K, C> Ord for RangeSet<K, C>
impl<K, C> Ord for RangeSet<K, C>
Source§impl<K, L, C, D> PartialEq<RangeSet<L, D>> for RangeSet<K, C>where
L: Measure<K> + PartialOrd<K> + PartialEnum,
K: PartialEnum,
C: SimpleCollectionRef + Slab<Node<AnyRange<K>, ()>>,
D: SimpleCollectionRef + Slab<Node<AnyRange<L>, ()>>,
impl<K, L, C, D> PartialEq<RangeSet<L, D>> for RangeSet<K, C>where
L: Measure<K> + PartialOrd<K> + PartialEnum,
K: PartialEnum,
C: SimpleCollectionRef + Slab<Node<AnyRange<K>, ()>>,
D: SimpleCollectionRef + Slab<Node<AnyRange<L>, ()>>,
Source§impl<K, L, C, D> PartialOrd<RangeSet<L, D>> for RangeSet<K, C>where
L: Measure<K> + PartialOrd<K> + PartialEnum,
K: PartialEnum,
C: SimpleCollectionRef + Slab<Node<AnyRange<K>, ()>>,
D: SimpleCollectionRef + Slab<Node<AnyRange<L>, ()>>,
impl<K, L, C, D> PartialOrd<RangeSet<L, D>> for RangeSet<K, C>where
L: Measure<K> + PartialOrd<K> + PartialEnum,
K: PartialEnum,
C: SimpleCollectionRef + Slab<Node<AnyRange<K>, ()>>,
D: SimpleCollectionRef + Slab<Node<AnyRange<L>, ()>>,
impl<K, C> Eq for RangeSet<K, C>
Auto Trait Implementations§
impl<T, C> Freeze for RangeSet<T, C>where
C: Freeze,
impl<T, C> RefUnwindSafe for RangeSet<T, C>where
C: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, C> Send for RangeSet<T, C>
impl<T, C> Sync for RangeSet<T, C>
impl<T, C> Unpin for RangeSet<T, C>
impl<T, C> UnwindSafe for RangeSet<T, C>where
C: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more