Skip to main content

Module utils

Module utils 

Source
Expand description

The crate::utils module represents the static methods that drive most of the overlap and consolidation intenrals. The static methods are exposed for general use and testing.

Enums§

RangeRelation
This enum is used to represent positional relationships between 2 ranges.

Functions§

consolidate
This function is the stateless implementation of crate::Consolidate.
first_range_begin_end
Looks for the first most range, if found returns an Option<(T,T)>.
grow
Given 2 instances of GetBeginEnd it returns a range that contains both.
last_range_begin_end
Looks for the last most range, if found returns an Option<(T,T)>.
min_max
Returns an Option wrapped tuple representing the smallest begin and largest end values found in src.
next_range_begin_end
Searches for the next smallest range valid range of (T,T) overlaps with begin. If no range overlaps with end, it finds the next smallest range after begin. Returns None when no matches were found.
next_smallest_range
previous_range_begin_end
Searches for the previous smallest range valid range of (T,T) overlaps with end. If no range overlaps with end, it finds the previous smallest range before begin. Returns None when no matches were found.
previous_smallest_range
Given the current begin and end, returns the smallest next range from src.
range_bounds_to_values
Range to value Conversion
range_relation
Compares the positional relationship between a and b.
reduce_back
Given the current begin and end, returns the smallest back range from src.
reduce_next
retool_begin
Computes the final value from a result of crate::reduce_back.
retool_end
Computes the final value from a result of crate::reduce_next.
sort_forward
Compares range a and b and returns the Forward Consolidation Order std::cmp::Ordering value.
sort_reverse
Compares range a and b and returns the Reverse Consolidation Order std::cmp::Ordering value.