context_bar_core/
time_windows.rs1use std::time::Duration;
2
3#[derive(Clone, Copy, Debug)]
4pub struct TimeWindow {
5 pub label: &'static str,
6 pub duration: Duration,
7}
8
9impl TimeWindow {
10 pub const fn new(label: &'static str, duration: Duration) -> Self {
11 Self { label, duration }
12 }
13}
14
15pub const NOW_WINDOW: TimeWindow = TimeWindow::new("now", Duration::from_secs(15 * 60));
16pub const SESSION_WINDOW: TimeWindow =
17 TimeWindow::new("session", Duration::from_secs(5 * 60 * 60));
18pub const WEEK_WINDOW: TimeWindow =
19 TimeWindow::new("week", Duration::from_secs(7 * 24 * 60 * 60));