pub trait WindowStore<K: Send + Sync, V: Send>: StateStore {
// Required methods
fn fetch_single<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
window_start: i64,
) -> Pin<Box<dyn Future<Output = Option<(i64, V)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
time_from: i64,
time_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(i64, V)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_with_ts<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
time_from: i64,
time_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(i64, i64, V)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn fetch_all_in_range<'life0, 'async_trait>(
&'life0 self,
start_from: i64,
start_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(K, i64, i64, V)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn put<'life0, 'async_trait>(
&'life0 mut self,
key: K,
window_start: i64,
value: V,
record_ts: i64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Typed windowed store keyed by (K, windowStart).
The store holds V and a record timestamp. fetch_single returns
(storedTs, V), so the aggregator can compute
newTs = max(recordTs, storedTs).
Required Methods§
fn fetch_single<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
window_start: i64,
) -> Pin<Box<dyn Future<Output = Option<(i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
time_from: i64,
time_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn fetch_with_ts<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
time_from: i64,
time_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(i64, i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_with_ts<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K,
time_from: i64,
time_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(i64, i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Like fetch, but also returns each window’s stored record timestamp.
The result is (windowStart, recordTs, value). The sliding-window
aggregator uses this method, because it needs windowMaxRecordTimestamp
to place the left and right windows.
Sourcefn fetch_all_in_range<'life0, 'async_trait>(
&'life0 self,
start_from: i64,
start_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(K, i64, i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_all_in_range<'life0, 'async_trait>(
&'life0 self,
start_from: i64,
start_to: i64,
) -> Pin<Box<dyn Future<Output = Vec<(K, i64, i64, V)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns every window across ALL keys whose windowStart is in
[start_from, start_to].
The result is (key, windowStart, recordTs, value). The emit-final
closed-window scan uses this method. The byte layout is key-prefixed, so
this is a filtered full scan that mirrors the JVM fetchAll.
fn put<'life0, 'async_trait>(
&'life0 mut self,
key: K,
window_start: i64,
value: V,
record_ts: i64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".