TakeWhileExt

Trait TakeWhileExt 

Source
pub trait TakeWhileExt<TItem, TFilter, S>: Stream<Item = StreamItem<TItem>> + Sized
where TItem: Fluxion, TItem::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, TItem::Timestamp: Debug + Ord + Copy + Send + Sync + 'static, TFilter: Fluxion<Timestamp = TItem::Timestamp>, TFilter::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, S: Stream<Item = StreamItem<TFilter>> + Send + Sync + 'static,
{ // Required method fn take_while_with( self, filter_stream: S, filter: impl Fn(&TFilter::Inner) -> bool + Send + Sync + 'static, ) -> impl Stream<Item = StreamItem<TItem>>; }
Expand description

Extension trait providing the take_while_with operator for timestamped streams.

Required Methods§

Source

fn take_while_with( self, filter_stream: S, filter: impl Fn(&TFilter::Inner) -> bool + Send + Sync + 'static, ) -> impl Stream<Item = StreamItem<TItem>>

Takes elements from the source stream while the filter predicate returns true.

§Arguments
  • filter_stream - Stream providing filter values that control emission
  • filter - Predicate function applied to filter values. Returns true to continue.

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<TItem, TFilter, S, P> TakeWhileExt<TItem, TFilter, S> for P
where P: Stream<Item = StreamItem<TItem>> + Unpin + Send + Sync + 'static, TItem: Fluxion, TItem::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, TItem::Timestamp: Debug + Ord + Copy + Send + Sync + 'static, TFilter: Fluxion<Timestamp = TItem::Timestamp>, TFilter::Inner: Clone + Debug + Ord + Unpin + Send + Sync + 'static, S: Stream<Item = StreamItem<TFilter>> + Send + Sync + 'static,