gnss_qc_traits/processing/
split.rs

1//! Split trait
2use hifitime::{Duration, Epoch};
3
4/// Implement [Split] to rearrange datasets timewise.
5pub trait Split {
6    /// [Split]s Self into two at specified [Epoch]
7    /// Returns:
8    ///  - (a , b) where a <= t and b > t
9    fn split(&self, t: Epoch) -> (Self, Self)
10    where
11        Self: Sized;
12
13    /// [Split]s Self with mutable access.
14    /// Modifies Self in place, retaining only <= t.
15    /// Returns > t.
16    fn split_mut(&mut self, t: Epoch) -> Self;
17
18    /// [Split]s Self into chunks of evenly spaced [Duration]
19    fn split_even_dt(&self, dt: Duration) -> Vec<Self>
20    where
21        Self: Sized;
22}