Trait differential_dataflow::input::Input[][src]

pub trait Input: TimelyInput {
    fn new_collection<D, R>(
        &mut self
    ) -> (InputSession<Self::Timestamp, D, R>, Collection<Self, D, R>)
    where
        D: Data,
        R: Semigroup
;
fn new_collection_from<I>(
        &mut self,
        data: I
    ) -> (InputSession<Self::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::Timestamp, D, R>, Collection<Self, D, R>)
    where
        I: IntoIterator<Item = (D, Self::Timestamp, R)> + 'static,
        D: Data,
        R: Semigroup + Data
; }

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

Required methods

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

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

Examples

extern crate timely;
extern crate differential_dataflow;

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

fn main() {
    ::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();
}

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

Create a new collection and input handle from initial data.

Examples

extern crate timely;
extern crate differential_dataflow;

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

fn main() {
    ::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();
}

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

Create a new collection and input handle from initial data.

Examples

extern crate timely;
extern crate differential_dataflow;

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

fn main() {
    ::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();
}
Loading content...

Implementors

impl<G: TimelyInput> Input for G where
    <G as ScopeParent>::Timestamp: Lattice
[src]

Loading content...