Skip to main content

filter_ranges

Function filter_ranges 

Source
pub fn filter_ranges(
    ranges: &[AvailableRange],
    after: Option<&RangeBound>,
    before: Option<&RangeBound>,
) -> Vec<AvailableRange>
Expand description

Filter ranges to those bookended by [after, before]:

  • after: keep only ranges whose start is at or after this bound
  • before: keep only ranges whose end is at or before this bound

When a bound is a RangeBound::Time, the range’s UTC timestamp fields are used; ranges that have no UTC timestamp for the relevant boundary are kept (conservative). When a bound is a RangeBound::Slot, slot fields are used directly.