pub struct DataStream { /* private fields */ }Expand description
A stream of events with chainable operators
Implementations§
Source§impl DataStream
impl DataStream
Sourcepub fn from_events(events: Vec<StreamEvent>) -> Self
pub fn from_events(events: Vec<StreamEvent>) -> Self
Create a new data stream from events
Sourcepub fn push(&mut self, event: StreamEvent)
pub fn push(&mut self, event: StreamEvent)
Add an event to the stream
Sourcepub fn key_by<F, K>(self, key_selector: F) -> KeyedStream<K>
pub fn key_by<F, K>(self, key_selector: F) -> KeyedStream<K>
Sourcepub fn window(self, config: WindowConfig) -> WindowedStream
pub fn window(self, config: WindowConfig) -> WindowedStream
Sourcepub fn reduce<F>(self, reducer: F) -> Option<StreamEvent>
pub fn reduce<F>(self, reducer: F) -> Option<StreamEvent>
Sourcepub fn collect(self) -> Vec<StreamEvent>
pub fn collect(self) -> Vec<StreamEvent>
Collect events into a vector
Sourcepub fn for_each<F>(self, action: F) -> Selfwhere
F: Fn(&StreamEvent),
pub fn for_each<F>(self, action: F) -> Selfwhere
F: Fn(&StreamEvent),
Sourcepub fn union(self, other: DataStream) -> Self
pub fn union(self, other: DataStream) -> Self
Union with another stream
Sourcepub fn find<F>(self, predicate: F) -> Option<StreamEvent>
pub fn find<F>(self, predicate: F) -> Option<StreamEvent>
Find events matching a pattern
Sourcepub fn group_by<F, K>(self, key_selector: F) -> GroupedStream<K>
pub fn group_by<F, K>(self, key_selector: F) -> GroupedStream<K>
Group events by a key and apply aggregation
Sourcepub fn aggregate<A>(self, aggregator: A) -> AggregateResultwhere
A: Aggregation,
pub fn aggregate<A>(self, aggregator: A) -> AggregateResultwhere
A: Aggregation,
Apply an aggregation function
Trait Implementations§
Source§impl Clone for DataStream
impl Clone for DataStream
Source§fn clone(&self) -> DataStream
fn clone(&self) -> DataStream
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DataStream
impl RefUnwindSafe for DataStream
impl Send for DataStream
impl Sync for DataStream
impl Unpin for DataStream
impl UnwindSafe for DataStream
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