WindowAssigner

Trait WindowAssigner 

Source
pub trait WindowAssigner: Send + Sync {
    type W: Clone + Debug + PartialEq + Eq + Hash + Send + Sync;

    // Required methods
    fn assign_windows(&self, timestamp: DateTime<Utc>) -> Vec<Self::W>;
    fn default_trigger(&self) -> Box<dyn WindowTrigger<Self::W>>;

    // Provided method
    fn is_event_time(&self) -> bool { ... }
}
Expand description

Trait for window assigners that assign elements to windows.

Window assigners determine which windows an element belongs to based on its timestamp or other properties.

Required Associated Types§

Source

type W: Clone + Debug + PartialEq + Eq + Hash + Send + Sync

The window type produced by this assigner.

Required Methods§

Source

fn assign_windows(&self, timestamp: DateTime<Utc>) -> Vec<Self::W>

Assign an element to zero or more windows.

§Arguments
  • timestamp - The timestamp of the element
§Returns

A vector of windows the element belongs to.

Source

fn default_trigger(&self) -> Box<dyn WindowTrigger<Self::W>>

Returns the default trigger for this assigner.

Provided Methods§

Source

fn is_event_time(&self) -> bool

Returns true if this assigner produces event-time windows.

Implementors§