pub struct WindowedStream { /* private fields */ }Expand description
A stream with windowing applied
Implementations§
Source§impl WindowedStream
impl WindowedStream
Sourcepub fn new(events: Vec<StreamEvent>, config: WindowConfig) -> Self
pub fn new(events: Vec<StreamEvent>, config: WindowConfig) -> Self
Create a new windowed stream
Sourcepub fn aggregate<A>(self, aggregator: A) -> Vec<AggregateResult>where
A: Aggregation,
pub fn aggregate<A>(self, aggregator: A) -> Vec<AggregateResult>where
A: Aggregation,
Apply aggregation to each window
Sourcepub fn reduce<F>(self, reducer: F) -> Vec<StreamEvent>
pub fn reduce<F>(self, reducer: F) -> Vec<StreamEvent>
Reduce events within each window
Sourcepub fn windows(&self) -> &[TimeWindow]
pub fn windows(&self) -> &[TimeWindow]
Get all windows
Sourcepub fn flatten(self) -> DataStream
pub fn flatten(self) -> DataStream
Flatten all windows back into a stream
Auto Trait Implementations§
impl Freeze for WindowedStream
impl RefUnwindSafe for WindowedStream
impl Send for WindowedStream
impl Sync for WindowedStream
impl Unpin for WindowedStream
impl UnwindSafe for WindowedStream
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