pub trait WindowManager: Clone + Send {
type In: Data;
type Out: Data;
type Output: IntoIterator<Item = WindowResult<Self::Out>>;
// Required method
fn process(&mut self, el: StreamElement<Self::In>) -> Self::Output;
// Provided method
fn recycle(&self) -> bool { ... }
}Expand description
Window Managers handle the windowing logic for a single partition (group) of the stream.
Elements passing on the stream partition will be fed to the manager through the process
method, the manager should then instantiate any new window if needed depending on its
logic and on the element passed as input. The input elements should be forwarded to any
relevant active window and the outputs for any window that has been closed after the
input event should be output as return value of the process function.
Required Associated Types§
Sourcetype Output: IntoIterator<Item = WindowResult<Self::Out>>
type Output: IntoIterator<Item = WindowResult<Self::Out>>
Type of the output of a call to process, it may be
a single WindowResult or an iterable collection, depending
on the windowing logic. (A single input may trigger the simultanous closure of
multiple windows)
Required Methods§
Sourcefn process(&mut self, el: StreamElement<Self::In>) -> Self::Output
fn process(&mut self, el: StreamElement<Self::In>) -> Self::Output
Process an input element updating any interest window. Output the results that have become ready after processing this element.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.