Crate range_union_find

source ·
Expand description

Provides a data structure backed by a vector for unioning ranges of integers. We intelligently merge inserted ranges to minimize required storage.

Example usage:

let mut range_holder = IntRangeUnionFind::<u32>::new();
assert_eq!(range_holder.has_range(&(2..=12))?, OverlapType::Partial(7));
assert_eq!(range_holder.has_range(&(5..=9))?, OverlapType::Contained);

All the functionality is in the IntRangeUnionFind struct (though we may add RangeUnionFind structs for different element types in the future).


Struct representing a union of integer ranges.


Enum describing what location an element has in a range.
Enum describing how a range may overlap with another range.
Enum describing how a range may be invalid.