pub struct WindowManager { /* private fields */ }Expand description
Manages multiple time windows for stream processing
Implementations§
Source§impl WindowManager
impl WindowManager
Sourcepub fn new(
window_type: WindowType,
duration: Duration,
max_events_per_window: usize,
max_windows: usize,
) -> Self
pub fn new( window_type: WindowType, duration: Duration, max_events_per_window: usize, max_windows: usize, ) -> Self
Create a new window manager
Sourcepub fn process_event(&mut self, event: StreamEvent)
pub fn process_event(&mut self, event: StreamEvent)
Process a new event through the window system
Sourcepub fn active_windows(&self) -> &[TimeWindow]
pub fn active_windows(&self) -> &[TimeWindow]
Get all active windows
Sourcepub fn latest_window(&self) -> Option<&TimeWindow>
pub fn latest_window(&self) -> Option<&TimeWindow>
Get the latest window
Sourcepub fn total_event_count(&self) -> usize
pub fn total_event_count(&self) -> usize
Get total event count across all windows
Sourcepub fn windows_with_event_type(&self, event_type: &str) -> Vec<&TimeWindow>
pub fn windows_with_event_type(&self, event_type: &str) -> Vec<&TimeWindow>
Get windows that contain events of a specific type
Sourcepub fn aggregate_across_windows<F>(&self, aggregator: F) -> f64
pub fn aggregate_across_windows<F>(&self, aggregator: F) -> f64
Calculate aggregate across all windows
Sourcepub fn get_statistics(&self) -> WindowStatistics
pub fn get_statistics(&self) -> WindowStatistics
Get window statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowManager
impl RefUnwindSafe for WindowManager
impl Send for WindowManager
impl Sync for WindowManager
impl Unpin for WindowManager
impl UnwindSafe for WindowManager
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