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§
Sourcefn into_empty_flag(self) -> boolwhere
Self: Sized,
fn into_empty_flag(self) -> boolwhere
Self: Sized,
Determines whether this range iterator represents the empty set.
Sourcefn into_inhabited_flag(self) -> boolwhere
Self: Sized,
fn into_inhabited_flag(self) -> boolwhere
Self: Sized,
Determines whether this range iterator is non-empty.
Sourcefn eqv(
self,
other: impl IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>,
) -> boolwhere
Self: Sized,
fn eqv(
self,
other: impl IntoNormalizedRangeIter<Item: ClosedRange<EndT = <Self::Item as ClosedRange>::EndT>>,
) -> boolwhere
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.
Sourcefn complement(self) -> ComplementIterator<Self>where
Self: Sized,
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.
Sourcefn intersect_vec<'a>(
self,
other: &'a RangeVec<<Self::Item as ClosedRange>::EndT>,
) -> IntersectionIterator<'a, Self>where
Self: 'a + Sized,
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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn collect_range_vec(self) -> RangeVec<<Self::Item as ClosedRange>::EndT>where
Self: Sized,
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).