Crate range_set

Source
Expand description

RangeSet container type.

RangeSet stores collections of PrimInt values as inclusive ranges using generic SmallVec-backed storage. This means that a certain amount of ranges will fit on the stack before spilling over to the heap.

Re-exports§

pub use range_compare::RangeCompare;
pub use range_compare::RangeDisjoint;
pub use range_compare::RangeIntersect;
pub use range_compare::range_compare;
pub use range_compare::intersection;

Modules§

range_compare
Type and functions for comparing inclusive ranges

Macros§

range_set
Convenient macro to construct RangeSets without needing bulky notation like ::<[RangeInclusive<_>; _]>. The macro allows a mix of numbers and inclusive ranges, with an optional length at the end for the smallvec array size. If the length is not specified, it will default to 4.

Structs§

Iter
Iterates over elements of the RangeSet
RangeSet
A set of primitive integers represented as a sorted list of disjoint, inclusive ranges.

Constants§

DEFAULT_RANGE_COUNT
The default size of the inner smallvec’s on-stack array.

Functions§

report_sizes
Report some sizes of various range set types
valid_range_slice
Tests a slice of ranges for validity as a range set: the element ranges must be properly disjoint (not adjacent) and sorted.