WindowManager

Trait WindowManager 

Source
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§

Source

type In: Data

Type of the input elements

Source

type Out: Data

Type of the output produced by each window

Source

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§

Source

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§

Source

fn recycle(&self) -> bool

Return true if the manager has no active windows and can be dropped

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.

Implementors§