Trait timely::dataflow::operators::core::filter::Filter

source ·
pub trait Filter<C: Container> {
    // Required method
    fn filter<P: FnMut(&C::Item<'_>) -> bool + 'static>(
        &self,
        predicate: P
    ) -> Self;
}
Expand description

Extension trait for filtering.

Required Methods§

source

fn filter<P: FnMut(&C::Item<'_>) -> bool + 'static>(&self, predicate: P) -> Self

Returns a new instance of self containing only records satisfying predicate.

§Examples
use timely::dataflow::operators::ToStream;
use timely::dataflow::operators::core::{Filter, Inspect};

timely::example(|scope| {
    (0..10).to_stream(scope)
           .filter(|x| *x % 2 == 0)
           .inspect(|x| println!("seen: {:?}", x));
});

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<G: Scope, C: PushContainer> Filter<C> for StreamCore<G, C>
where for<'a> C::Item<'a>: PushInto<C>,