Expand description
A library for working with set of values represented as inclusive ranges.
This library provides a RangeList
struct that can be used to represent
sets of values as a collection of inclusive ranges. The ranges are stored
in a deduplicated sorted order.
Additionally, the library defines IntervalIterator
trait to be
implemented by types can provide an iterator of sorted inclusive
ranges. Any combination of types that implement this trait can be used
to perform standard set operations such as union and intersection.
Finally, the library provides DiffIter
, IntersectIter
, and
UnionIter
, which are lazy iterator combinators that can be used to
perform set operations on two iterators of ordered ranges.
Structs§
- Diff
Iter - An iterator combinator that given two iterators yielding ordered ranges,
yields the ordered ranges of elements that are in the ranges yielded by
lhs
iterator, but does not include elements that are in the ranges yielded by therhs
iterator. - Intersect
Iter - An iterator combinator that given two iterators yielding ordered ranges, yields the ordered ranges that are in the intersection of the ranges yielded by the iterators.
- Range
List - A sorted collection of inclusive ranges that can be used to represent non-continuous sets of values.
- Union
Iter - An iterator combinator that given two iterators yielding ordered ranges, yields the ordered ranges that are in the union of the ranges yielded by the iterators.
Traits§
- Interval
Iterator - A trait that provides operations on iterators of orderdered intervals.