pub trait WindowState: EstimateSize {
// Required methods
fn append(&mut self, key: StateKey, args: SmallVec<[Datum; 2]>);
fn curr_window(&self) -> StatePos<'_>;
fn slide(&mut self) -> Result<(Datum, StateEvictHint)>;
fn slide_no_output(&mut self) -> Result<StateEvictHint>;
}
Required Methods§
sourcefn append(&mut self, key: StateKey, args: SmallVec<[Datum; 2]>)
fn append(&mut self, key: StateKey, args: SmallVec<[Datum; 2]>)
Append a new input row to the state. The key
is expected to be increasing.
sourcefn curr_window(&self) -> StatePos<'_>
fn curr_window(&self) -> StatePos<'_>
Get the current window frame position.
sourcefn slide(&mut self) -> Result<(Datum, StateEvictHint)>
fn slide(&mut self) -> Result<(Datum, StateEvictHint)>
Slide the window frame forward and collect the output and evict hint. Similar to Iterator::next
.
sourcefn slide_no_output(&mut self) -> Result<StateEvictHint>
fn slide_no_output(&mut self) -> Result<StateEvictHint>
Slide the window frame forward and collect the evict hint. Don’t calculate the output if possible.