Trait raphtory::db::api::view::TimeOps

source ·
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§

source

fn start(&self) -> Option<i64>

Return the timestamp of the default start for perspectives of the view (if any).

source

fn end(&self) -> Option<i64>

Return the timestamp of the default for perspectives of the view (if any).

source

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§

source

fn window_size(&self) -> Option<u64>

Return the size of the window covered by this view

source

fn at<T: IntoTime>(&self, end: T) -> Self::WindowedViewType

Create a view including all events until end (inclusive)

source

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.

source

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.

Implementors§