Skip to main content

Input

Trait Input 

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

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

Required Methods§

Source

fn new_collection<D, R>( &self, ) -> (InputSession<Self::Timestamp, D, R>, VecCollection<'scope, Self::Timestamp, D, R>)
where D: Data, R: Semigroup + 'static,

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>( &self, data: I, ) -> (InputSession<Self::Timestamp, I::Item, isize>, VecCollection<'scope, Self::Timestamp, I::Item, isize>)
where I: IntoIterator<Item: Data> + 'static,

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>( &self, data: I, ) -> (InputSession<Self::Timestamp, D, R>, VecCollection<'scope, Self::Timestamp, D, R>)
where I: IntoIterator<Item = (D, Self::Timestamp, R)> + 'static, D: Data, R: Semigroup + 'static,

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();

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.

Implementations on Foreign Types§

Source§

impl<'scope, T: Timestamp + Lattice + TotalOrder> Input<'scope> for Scope<'scope, T>

Source§

fn new_collection<D, R>( &self, ) -> (InputSession<T, D, R>, VecCollection<'scope, T, D, R>)
where D: Data, R: Semigroup + 'static,

Source§

fn new_collection_from<I>( &self, data: I, ) -> (InputSession<T, I::Item, isize>, VecCollection<'scope, T, I::Item, isize>)
where I: IntoIterator + 'static, I::Item: Data,

Source§

fn new_collection_from_raw<D, R, I>( &self, data: I, ) -> (InputSession<T, D, R>, VecCollection<'scope, T, D, R>)
where D: Data, R: Semigroup + 'static, I: IntoIterator<Item = (D, T, R)> + 'static,

Implementors§