pub struct WindowStatefulTestHelper { /* private fields */ }Expand description
Test helper for FFIWindowStateful operators
Implementations§
Source§impl WindowStatefulTestHelper
impl WindowStatefulTestHelper
Sourcepub fn new(layout: EncodedValuesLayout, window_size: i64) -> Self
pub fn new(layout: EncodedValuesLayout, window_size: i64) -> Self
Create a new window stateful test helper
Sourcepub fn time_window_counter(window_size_seconds: i64) -> Self
pub fn time_window_counter(window_size_seconds: i64) -> Self
Create with a counter layout for time windows
Sourcepub fn count_window_sum(window_size_count: i64) -> Self
pub fn count_window_sum(window_size_count: i64) -> Self
Create with a sum layout for count windows
Sourcepub fn set_window_state<K>(&mut self, window_id: i64, key: K, values: &[Value])where
K: IntoEncodedKey,
pub fn set_window_state<K>(&mut self, window_id: i64, key: K, values: &[Value])where
K: IntoEncodedKey,
Set state for a window and key
Sourcepub fn get_window_state<K>(&self, window_id: i64, key: K) -> Option<Vec<Value>>where
K: IntoEncodedKey,
pub fn get_window_state<K>(&self, window_id: i64, key: K) -> Option<Vec<Value>>where
K: IntoEncodedKey,
Get state for a window and key
Sourcepub fn assert_window_state<K>(&self, window_id: i64, key: K, expected: &[Value])where
K: IntoEncodedKey,
pub fn assert_window_state<K>(&self, window_id: i64, key: K, expected: &[Value])where
K: IntoEncodedKey,
Assert state for a window and key
Sourcepub fn get_window(
&self,
window_id: i64,
) -> Option<&HashMap<EncodedKey, EncodedValues>>
pub fn get_window( &self, window_id: i64, ) -> Option<&HashMap<EncodedKey, EncodedValues>>
Get all states for a window
Sourcepub fn remove_window(
&mut self,
window_id: i64,
) -> Option<HashMap<EncodedKey, EncodedValues>>
pub fn remove_window( &mut self, window_id: i64, ) -> Option<HashMap<EncodedKey, EncodedValues>>
Remove a window
Sourcepub fn has_window(&self, window_id: i64) -> bool
pub fn has_window(&self, window_id: i64) -> bool
Check if a window exists
Sourcepub fn window_count(&self) -> usize
pub fn window_count(&self) -> usize
Get the number of windows
Sourcepub fn window_key_count(&self, window_id: i64) -> usize
pub fn window_key_count(&self, window_id: i64) -> usize
Get the number of keys in a window
Sourcepub fn window_ids(&self) -> Vec<i64>
pub fn window_ids(&self) -> Vec<i64>
Get all window IDs
Sourcepub fn assert_window_count(&self, expected: usize)
pub fn assert_window_count(&self, expected: usize)
Assert the number of windows
Sourcepub fn window_for_timestamp(&self, timestamp: i64) -> i64
pub fn window_for_timestamp(&self, timestamp: i64) -> i64
Calculate the window ID for a timestamp
Auto Trait Implementations§
impl Freeze for WindowStatefulTestHelper
impl RefUnwindSafe for WindowStatefulTestHelper
impl Send for WindowStatefulTestHelper
impl Sync for WindowStatefulTestHelper
impl Unpin for WindowStatefulTestHelper
impl UnwindSafe for WindowStatefulTestHelper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more