Skip to main content

Crate shiplog_coverage

Crate shiplog_coverage 

Source
Expand description

Date-window utilities for coverage and ingestion slicing.

This crate owns the coverage-facing windowing primitives that keep query windows explicit, contiguous, and auditable.

§Examples

use shiplog_coverage::{month_windows, week_windows, day_windows, window_len_days};
use chrono::NaiveDate;

let since = NaiveDate::from_ymd_opt(2025, 1, 1).unwrap();
let until = NaiveDate::from_ymd_opt(2025, 4, 1).unwrap();

let months = month_windows(since, until);
assert_eq!(months.len(), 3); // Jan, Feb, Mar

assert_eq!(window_len_days(&months[0]), 31);

Functions§

day_windows
Split a half-open date range into day windows.
month_windows
Split a half-open date range into month-start anchored windows.
week_windows
Split a half-open date range into Monday-started week windows.
window_len_days
Number of days covered by a window.