ScanOrderedExt

Trait ScanOrderedExt 

Source
pub trait ScanOrderedExt<T>: Stream<Item = StreamItem<T>> + Sized
where T: Fluxion, T::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, T::Timestamp: Debug + Ord + Copy + Send + Sync + 'static,
{ // Required method fn scan_ordered<Out, Acc, F>( self, initial: Acc, accumulator: F, ) -> impl Stream<Item = StreamItem<Out>> where Acc: Send + Sync + 'static, Out: Fluxion, Out::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, Out::Timestamp: From<T::Timestamp> + Debug + Ord + Copy + Send + Sync + 'static, F: FnMut(&mut Acc, &T::Inner) -> Out::Inner + Send + Sync + 'static; }
Expand description

Extension trait providing the scan_ordered operator for streams.

See the module-level documentation for details and examples.

Required Methods§

Source

fn scan_ordered<Out, Acc, F>( self, initial: Acc, accumulator: F, ) -> impl Stream<Item = StreamItem<Out>>
where Acc: Send + Sync + 'static, Out: Fluxion, Out::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, Out::Timestamp: From<T::Timestamp> + Debug + Ord + Copy + Send + Sync + 'static, F: FnMut(&mut Acc, &T::Inner) -> Out::Inner + Send + Sync + 'static,

Accumulates state across stream items, emitting intermediate results.

The scan_ordered operator maintains an accumulator value that is updated for each input item. For each input, it calls the accumulator function with a mutable reference to the current state and the input value, producing an output value.

See the module-level documentation for details.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, S> ScanOrderedExt<T> for S
where S: Stream<Item = StreamItem<T>> + Send + Sync + Sized + 'static, T: Fluxion, T::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, T::Timestamp: Debug + Ord + Copy + Send + Sync + 'static,