NormalizedRangeIter

Trait NormalizedRangeIter 

Source
pub trait NormalizedRangeIter: Sealed + Iterator<Item: ClosedRange> {
    // Provided methods
    fn into_empty_flag(self) -> bool
       where Self: Sized { ... }
    fn into_inhabited_flag(self) -> bool
       where Self: Sized { ... }
    fn eqv(
        self,
        other: impl IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>,
    ) -> bool
       where Self: Sized { ... }
    fn complement(self) -> ComplementIterator<Self>
       where Self: Sized { ... }
    fn intersect_vec<'a>(
        self,
        other: &'a RangeVec<<Self::Item as ClosedRange>::EndT>,
    ) -> IntersectionIterator<'a, Self>
       where Self: 'a + Sized { ... }
    fn intersect<Other>(
        self,
        other: Other,
    ) -> LinearIntersectionIterator<<Self::Item as ClosedRange>::EndT, Self, <Other as IntoIterator>::IntoIter>
       where Self: Sized,
             Other: IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>> { ... }
    fn union<Other>(
        self,
        other: Other,
    ) -> UnionIterator<<Self::Item as ClosedRange>::EndT, Self, <Other as IntoIterator>::IntoIter>
       where Self: Sized,
             Other: IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>> { ... }
    fn collect_range_vec(self) -> RangeVec<<Self::Item as ClosedRange>::EndT>
       where Self: Sized { ... }
}
Expand description

A NormalizedRangeIter yields a sorted sequence of non-overlapping, non-adjacent, non-empty closed ranges.

It’s hard to check for this property at runtime, so this trait is sealed.

Provided Methods§

Source

fn into_empty_flag(self) -> bool
where Self: Sized,

Determines whether this range iterator represents the empty set.

Source

fn into_inhabited_flag(self) -> bool
where Self: Sized,

Determines whether this range iterator is non-empty.

Source

fn eqv( self, other: impl IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>, ) -> bool
where Self: Sized,

Determines whether this range iterator is equivalent to (represents the same set of values as) another.

This operation takes constant space and time linear in the shorter length of the two input iterators.

Source

fn complement(self) -> ComplementIterator<Self>
where Self: Sized,

Returns an iterator for the complement of this normalized range iterator.

Running the resulting iterator to exhaustion takes constant space and time linear in the length of the input iterator.

The result is also a NormalizedRangeIter.

Source

fn intersect_vec<'a>( self, other: &'a RangeVec<<Self::Item as ClosedRange>::EndT>, ) -> IntersectionIterator<'a, Self>
where Self: 'a + Sized,

Returns an iterator for the intersection of this normalized range iterator and another RangeVec of normalized ranges.

Running the resulting iterator to exhaustion takes constant space and \(\mathcal{O}(\min(m + n, m \log n))\) time, where \(m\) is the size of self, and \(n\) that of other.

The result is also a NormalizedRangeIter.

Source

fn intersect<Other>( self, other: Other, ) -> LinearIntersectionIterator<<Self::Item as ClosedRange>::EndT, Self, <Other as IntoIterator>::IntoIter>
where Self: Sized, Other: IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>,

Returns an iterator for the intersection of this normalized range iterator and another iterator of normalized ranges.

Running the resulting iterator to exhaustion takes constant space and time linear in the total length of the two input iterators.

The result is also a NormalizedRangeIter.

Source

fn union<Other>( self, other: Other, ) -> UnionIterator<<Self::Item as ClosedRange>::EndT, Self, <Other as IntoIterator>::IntoIter>
where Self: Sized, Other: IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>,

Returns an interator for the union of this normalized range iterator and another normalized range iterator.

Running the resulting iterator to exhaustion takes constant space and time linear in the total length of the two input iterators.

The result is also a NormalizedRangeIter.

Source

fn collect_range_vec(self) -> RangeVec<<Self::Item as ClosedRange>::EndT>
where Self: Sized,

Collects the contents of a NormalizedRangeIter into a RangeVec.

This takes time linear in the length of the input iterator (in addition to the resources used by the iterator itself).

Trait Implementations§

Source§

impl<T: 'static + Endpoint, X: 'static + ClosedRange<EndT = T>, Y: 'static + ClosedRange<EndT = T>> BitAnd<Box<dyn NormalizedRangeIter<Item = Y>>> for Box<dyn NormalizedRangeIter<Item = X>>

Source§

type Output = Box<dyn NormalizedRangeIter<Item = (T, T)>>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Box<dyn NormalizedRangeIter<Item = Y>>) -> Self::Output

Performs the & operation. Read more
Source§

impl<T: 'static + Endpoint, X: 'static + ClosedRange<EndT = T>, Y: 'static + ClosedRange<EndT = T>> BitOr<Box<dyn NormalizedRangeIter<Item = Y>>> for Box<dyn NormalizedRangeIter<Item = X>>

Source§

type Output = Box<dyn NormalizedRangeIter<Item = (T, T)>>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Box<dyn NormalizedRangeIter<Item = Y>>) -> Self::Output

Performs the | operation. Read more
Source§

impl<T: Endpoint + 'static, X: 'static + ClosedRange<EndT = T>> Not for Box<dyn NormalizedRangeIter<Item = X>>

Source§

type Output = Box<dyn NormalizedRangeIter<Item = (T, T)>>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more

Implementations on Foreign Types§

Source§

impl<T: NormalizedRangeIter + ?Sized> NormalizedRangeIter for Box<T>

Implementors§