pub trait TimeOps {
type WindowedViewType: TimeOps;
// Required methods
fn start(&self) -> Option<i64>;
fn end(&self) -> Option<i64>;
fn window<T: IntoTime>(
&self,
t_start: T,
t_end: T
) -> Self::WindowedViewType;
// Provided methods
fn window_size(&self) -> Option<u64> { ... }
fn at<T: IntoTime>(&self, end: T) -> Self::WindowedViewType { ... }
fn expanding<I>(&self, step: I) -> Result<WindowSet<Self>, ParseTimeError>
where Self: Sized + Clone + 'static,
I: TryInto<Interval, Error = ParseTimeError> { ... }
fn rolling<I>(
&self,
window: I,
step: Option<I>
) -> Result<WindowSet<Self>, ParseTimeError>
where Self: Sized + Clone + 'static,
I: TryInto<Interval, Error = ParseTimeError> { ... }
}Expand description
Trait defining time query operations
Required Associated Types§
Required Methods§
sourcefn start(&self) -> Option<i64>
fn start(&self) -> Option<i64>
Return the timestamp of the default start for perspectives of the view (if any).
sourcefn end(&self) -> Option<i64>
fn end(&self) -> Option<i64>
Return the timestamp of the default for perspectives of the view (if any).
sourcefn window<T: IntoTime>(&self, t_start: T, t_end: T) -> Self::WindowedViewType
fn window<T: IntoTime>(&self, t_start: T, t_end: T) -> Self::WindowedViewType
Create a view including all events between t_start (inclusive) and t_end (exclusive)
Provided Methods§
sourcefn window_size(&self) -> Option<u64>
fn window_size(&self) -> Option<u64>
Return the size of the window covered by this view
sourcefn at<T: IntoTime>(&self, end: T) -> Self::WindowedViewType
fn at<T: IntoTime>(&self, end: T) -> Self::WindowedViewType
Create a view including all events until end (inclusive)
sourcefn expanding<I>(&self, step: I) -> Result<WindowSet<Self>, ParseTimeError>where
Self: Sized + Clone + 'static,
I: TryInto<Interval, Error = ParseTimeError>,
fn expanding<I>(&self, step: I) -> Result<WindowSet<Self>, ParseTimeError>where Self: Sized + Clone + 'static, I: TryInto<Interval, Error = ParseTimeError>,
Creates a WindowSet with the given step size
using an expanding window. The last window may fall partially outside the range of the data/view.
An expanding window is a window that grows by step size at each iteration.
sourcefn rolling<I>(
&self,
window: I,
step: Option<I>
) -> Result<WindowSet<Self>, ParseTimeError>where
Self: Sized + Clone + 'static,
I: TryInto<Interval, Error = ParseTimeError>,
fn rolling<I>( &self, window: I, step: Option<I> ) -> Result<WindowSet<Self>, ParseTimeError>where Self: Sized + Clone + 'static, I: TryInto<Interval, Error = ParseTimeError>,
Creates a WindowSet with the given window size and optional step
using a rolling window. The last window may fall partially outside the range of the data/view.
A rolling window is a window that moves forward by step size at each iteration.