Crate range_union_find[−][src]
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(); range_holder.insert_range(&(4..=8))?; range_holder.insert_range(&(6..=10))?; assert_eq!(range_holder.range_contained(&(2..=12))?, OverlapType::Partial(7)); assert_eq!(range_holder.range_contained(&(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).
Structs
IntRangeUnionFind | Struct representing a union of integer ranges. |
Enums
ContainedType | Enum describing what location an element has in a range. |
OverlapType | Enum describing how a range may overlap with another range. |
RangeOperationError | Enum describing how a range may be invalid. |