Skip to main content

StreamVec

Type Alias StreamVec 

Source
pub type StreamVec<S, D> = Stream<S, Vec<D>>;
Expand description

A stream batching data in owning vectors.

Aliased Type§

pub struct StreamVec<S, D> { /* private fields */ }

Trait Implementations§

Source§

impl<G: Scope<Timestamp: Hash>, D: 'static> Accumulate<G, D> for StreamVec<G, D>

Source§

fn accumulate<A: Clone + 'static>( self, default: A, logic: impl Fn(&mut A, &mut Vec<D>) + 'static, ) -> StreamVec<G, A>

Accumulates records within a timestamp. Read more
Source§

fn count(self) -> StreamVec<G, usize>

Counts the number of records observed at each time. Read more
Source§

impl<S: Scope<Timestamp: Hash>, K: ExchangeData + Clone + Hash + Eq, V: ExchangeData> Aggregate<S, K, V> for StreamVec<S, (K, V)>

Source§

fn aggregate<R: 'static, D: Default + 'static, F: Fn(&K, V, &mut D) + 'static, E: Fn(K, D) -> R + 'static, H: Fn(&K) -> u64 + 'static>( self, fold: F, emit: E, hash: H, ) -> StreamVec<S, R>
where S::Timestamp: Eq,

Aggregates data of the form (key, val), using user-supplied logic. Read more
Source§

impl<S: Scope, D: 'static> Branch<S, D> for StreamVec<S, D>

Source§

fn branch( self, condition: impl Fn(&S::Timestamp, &D) -> bool + 'static, ) -> (StreamVec<S, D>, StreamVec<S, D>)

Takes one input stream and splits it into two output streams. For each record, the supplied closure is called with a reference to the data and its time. If it returns true, the record will be sent to the second returned stream, otherwise it will be sent to the first. Read more
Source§

impl<G: Scope, D: ExchangeData + Clone> Broadcast<D> for StreamVec<G, D>

Source§

fn broadcast(self) -> StreamVec<G, D>

Broadcast records to all workers. Read more
Source§

impl<G: Scope<Timestamp: Hash>, D: 'static> Delay<G, D> for StreamVec<G, D>

Source§

fn delay<L: FnMut(&D, &G::Timestamp) -> G::Timestamp + 'static>( self, func: L, ) -> Self

Advances the timestamp of records using a supplied function. Read more
Source§

fn delay_total<L: FnMut(&D, &G::Timestamp) -> G::Timestamp + 'static>( self, func: L, ) -> Self

Advances the timestamp of records using a supplied function. Read more
Source§

fn delay_batch<L: FnMut(&G::Timestamp) -> G::Timestamp + 'static>( self, func: L, ) -> Self

Advances the timestamp of batches of records using a supplied function. Read more
Source§

impl<G: Scope, D: 'static> Filter<D> for StreamVec<G, D>

Source§

fn filter<P: FnMut(&D) -> bool + 'static>(self, predicate: P) -> StreamVec<G, D>

Returns a new instance of self containing only records satisfying predicate. Read more
Source§

impl<S: Scope, D: 'static> Map<S, D> for StreamVec<S, D>

Source§

fn map_in_place<L: FnMut(&mut D) + 'static>(self, logic: L) -> StreamVec<S, D>

Updates each element of the stream and yields the element, re-using memory where possible. Read more
Source§

fn flat_map<I: IntoIterator, L: FnMut(D) -> I + 'static>( self, logic: L, ) -> StreamVec<S, I::Item>
where I::Item: 'static,

Consumes each element of the stream and yields some number of new elements. Read more
Source§

fn map<D2: 'static, L: FnMut(D) -> D2 + 'static>( self, logic: L, ) -> StreamVec<S, D2>

Consumes each element of the stream and yields a new element. Read more
Source§

impl<G: Scope, D: 'static, D2: 'static, F: Fn(D) -> (u64, D2) + 'static> Partition<G, D, D2, F> for StreamVec<G, D>

Source§

fn partition(self, parts: u64, route: F) -> Vec<StreamVec<G, D2>>

Produces parts output streams, containing records produced and assigned by route. Read more
Source§

impl<S: Scope, T: 'static, E: 'static> ResultStream<S, T, E> for StreamVec<S, Result<T, E>>

Source§

fn ok(self) -> StreamVec<S, T>

Returns a new instance of self containing only ok records. Read more
Source§

fn err(self) -> StreamVec<S, E>

Returns a new instance of self containing only err records. Read more
Source§

fn map_ok<T2: 'static, L: FnMut(T) -> T2 + 'static>( self, logic: L, ) -> StreamVec<S, Result<T2, E>>

Returns a new instance of self applying logic on all Ok records. Read more
Source§

fn map_err<E2: 'static, L: FnMut(E) -> E2 + 'static>( self, logic: L, ) -> StreamVec<S, Result<T, E2>>

Returns a new instance of self applying logic on all Err records. Read more
Source§

fn and_then<T2: 'static, L: FnMut(T) -> Result<T2, E> + 'static>( self, logic: L, ) -> StreamVec<S, Result<T2, E>>

Returns a new instance of self applying logic on all Ok records, passes through Err records. Read more
Source§

fn unwrap_or_else<L: FnMut(E) -> T + 'static>(self, logic: L) -> StreamVec<S, T>

Returns a new instance of self applying logic on all Ok records. Read more
Source§

impl<S: Scope, K: ExchangeData + Hash + Eq + Clone, V: ExchangeData> StateMachine<S, K, V> for StreamVec<S, (K, V)>

Source§

fn state_machine<R: 'static, D: Default + 'static, I: IntoIterator<Item = R>, F: Fn(&K, V, &mut D) -> (bool, I) + 'static, H: Fn(&K) -> u64 + 'static>( self, fold: F, hash: H, ) -> StreamVec<S, R>
where S::Timestamp: Hash + Eq,

Tracks a state for each presented key, using user-supplied state transition logic. Read more