Trait differential_dataflow::input::Input

source ·
pub trait Input: TimelyInput {
    // Required methods
    fn new_collection<D, R>(
        &mut self
    ) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
       where D: Data,
             R: Semigroup;
    fn new_collection_from<I>(
        &mut self,
        data: I
    ) -> (InputSession<<Self as ScopeParent>::Timestamp, I::Item, isize>, Collection<Self, I::Item, isize>)
       where I: IntoIterator + 'static,
             I::Item: Data;
    fn new_collection_from_raw<D, R, I>(
        &mut self,
        data: I
    ) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
       where I: IntoIterator<Item = (D, <Self as ScopeParent>::Timestamp, R)> + 'static,
             D: Data,
             R: Semigroup + Data;
}
Expand description

Create a new collection and input handle to control the collection.

Required Methods§

source

fn new_collection<D, R>( &mut self ) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
where D: Data, R: Semigroup,

Create a new collection and input handle to subsequently control the collection.

§Examples
use timely::Config;
use differential_dataflow::input::Input;

::timely::execute(Config::thread(), |worker| {

    let (mut handle, probe) = worker.dataflow::<(),_,_>(|scope| {
        // create input handle and collection.
        let (handle, data) = scope.new_collection();
        let probe = data.map(|x| x * 2)
                        .inspect(|x| println!("{:?}", x))
                        .probe();
        (handle, probe)
    });

    handle.insert(1);
    handle.insert(5);

}).unwrap();
source

fn new_collection_from<I>( &mut self, data: I ) -> (InputSession<<Self as ScopeParent>::Timestamp, I::Item, isize>, Collection<Self, I::Item, isize>)
where I: IntoIterator + 'static, I::Item: Data,

Create a new collection and input handle from initial data.

§Examples
use timely::Config;
use differential_dataflow::input::Input;

::timely::execute(Config::thread(), |worker| {

    let (mut handle, probe) = worker.dataflow::<(),_,_>(|scope| {
        // create input handle and collection.
         let (handle, data) = scope.new_collection_from(0 .. 10);
         let probe = data.map(|x| x * 2)
                         .inspect(|x| println!("{:?}", x))
                         .probe();
         (handle, probe)
    });

    handle.insert(1);
    handle.insert(5);

}).unwrap();
source

fn new_collection_from_raw<D, R, I>( &mut self, data: I ) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
where I: IntoIterator<Item = (D, <Self as ScopeParent>::Timestamp, R)> + 'static, D: Data, R: Semigroup + Data,

Create a new collection and input handle from initial data.

§Examples
use timely::Config;
use differential_dataflow::input::Input;

::timely::execute(Config::thread(), |worker| {

    let (mut handle, probe) = worker.dataflow::<(),_,_>(|scope| {
        // create input handle and collection.
        let (handle, data) = scope.new_collection_from(0 .. 10);
        let probe = data.map(|x| x * 2)
                        .inspect(|x| println!("{:?}", x))
                        .probe();
        (handle, probe)
    });

    handle.insert(1);
    handle.insert(5);

}).unwrap();

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<G: TimelyInput> Input for G
where <G as ScopeParent>::Timestamp: Lattice,