Trait WindowImpl

Source
pub(super) trait WindowImpl {
    type Key: Ord;
    type Value: Clone;

    // Required methods
    fn preceding_saturated(
        &self,
        window: BufferRef<'_, Self::Key, Self::Value>,
    ) -> bool;
    fn following_saturated(
        &self,
        window: BufferRef<'_, Self::Key, Self::Value>,
    ) -> bool;
    fn recalculate_left_right(
        &mut self,
        window: BufferRefMut<'_, Self::Key, Self::Value>,
        hint: RecalculateHint,
    );
    fn shift_indices(&mut self, n: usize);
}
Expand description

A trait for sliding window implementations. This trait is used by WindowBuffer to determine the status of current window and how to slide the window.

Required Associated Types§

Required Methods§

Source

fn preceding_saturated( &self, window: BufferRef<'_, Self::Key, Self::Value>, ) -> bool

Whether the preceding half of the current window is saturated. By “saturated” we mean that every row that is possible to be in the preceding half of the current window is already in the buffer.

Source

fn following_saturated( &self, window: BufferRef<'_, Self::Key, Self::Value>, ) -> bool

Whether the following half of the current window is saturated.

Source

fn recalculate_left_right( &mut self, window: BufferRefMut<'_, Self::Key, Self::Value>, hint: RecalculateHint, )

Recalculate the left and right indices of the current window, according to the latest curr_idx and the hint.

Source

fn shift_indices(&mut self, n: usize)

Shift the indices stored by the WindowImpl by n positions. This should be called after evicting rows from the buffer.

Implementors§

Source§

impl<K: Ord, V: Clone> WindowImpl for RowsWindow<K, V>

Source§

type Key = K

Source§

type Value = V

Source§

impl<V: Clone> WindowImpl for RangeWindow<V>

Source§

type Key = StateKey

Source§

type Value = V

Source§

impl<V: Clone> WindowImpl for SessionWindow<V>

Source§

type Key = StateKey

Source§

type Value = V