pub fn complement_within<T: TimeInstant>(
outer: Interval<T>,
periods: &[Interval<T>],
) -> Vec<Interval<T>>Expand description
Returns the gaps (complement) of periods within the bounding outer period.
Given a sorted, non-overlapping list of sub-periods and a bounding period, this returns the time intervals NOT covered by any sub-period.
Both outer and every element of periods must have start <= end.
The function runs in O(n) time with a single pass.
§Arguments
outer- The bounding periodperiods- Sorted, non-overlapping sub-periods withinouter
§Returns
The complement periods (gaps) in chronological order.