timely::dataflow::operators::filter

Trait Filter

Source
pub trait Filter<D: Data> {
    // Required method
    fn filter<P: FnMut(&D) -> bool + 'static>(&self, predicate: P) -> Self;
}
Expand description

Extension trait for filtering.

Required Methods§

Source

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

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

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

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

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<G: Scope, D: Data> Filter<D> for Stream<G, D>