pub fn range_bounds_to_values<T, V>(
range: &impl RangeBounds<T>,
rebound: &V,
cmp: &impl IncDecCpCmp<T, V>,
) -> Option<(T, T)>Expand description
Range to value Conversion
This method takes a std::ops::RangeBounds and returns the calculted values for the type.
For conversion of start values
- std::ops::Bound::Unbounded becomes $t::MIN
- std::ops::Bound::Included value is not changed
- std::ops::Bound::Excluded value is incremented
For conversion of end values
- std::ops::Bound::Unbounded becomes $t::MAX
- std::ops::Bound::Included value is not changed
- std::ops::Bound::Excluded value is decremented
See IncDecCpCmp for more details.
Example of range to number conversion.