pub struct WindowOperator<S> { /* private fields */ }Expand description
A simple window operator keyed only by window time (no grouping key here, for clarity). Maintains state per window and emits results when watermark >= window.end.
Implementations§
Source§impl<S> WindowOperator<S>
 
impl<S> WindowOperator<S>
pub fn new<Init, Red>(assigner: WindowAssigner, init: Init, reduce: Red) -> Self
Sourcepub fn with_backend(
    self,
    backend: Arc<dyn KvState>,
    ns_prefix: impl AsRef<[u8]>,
) -> Self
 
pub fn with_backend( self, backend: Arc<dyn KvState>, ns_prefix: impl AsRef<[u8]>, ) -> Self
Configure an external KeyValueState backend for durable window state and a namespace prefix.
pub fn on_element(&mut self, ts: DateTime<Utc>, value: &Value)
pub fn on_watermark(&mut self, watermark: DateTime<Utc>) -> Vec<(Window, S)>
Sourcepub async fn restore_from_backend(&mut self) -> Result<()>where
    S: for<'de> Deserialize<'de>,
 
pub async fn restore_from_backend(&mut self) -> Result<()>where
    S: for<'de> Deserialize<'de>,
Restore in-memory window states from the backend for this namespace.
Auto Trait Implementations§
impl<S> Freeze for WindowOperator<S>
impl<S> !RefUnwindSafe for WindowOperator<S>
impl<S> Send for WindowOperator<S>where
    S: Send,
impl<S> Sync for WindowOperator<S>where
    S: Sync,
impl<S> Unpin for WindowOperator<S>where
    S: Unpin,
impl<S> !UnwindSafe for WindowOperator<S>
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