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 + 'static;
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 + 'static;
}
Expand description
Create a new collection and input handle to control the collection.
Required Methods§
sourcefn new_collection<D, R>(
&mut self,
) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
fn new_collection<D, R>( &mut self, ) -> (InputSession<<Self as ScopeParent>::Timestamp, D, R>, Collection<Self, D, R>)
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();
sourcefn new_collection_from<I>(
&mut self,
data: I,
) -> (InputSession<<Self as ScopeParent>::Timestamp, I::Item, isize>, Collection<Self, I::Item, isize>)
fn new_collection_from<I>( &mut self, data: I, ) -> (InputSession<<Self as ScopeParent>::Timestamp, I::Item, isize>, Collection<Self, I::Item, isize>)
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();
sourcefn 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 + 'static,
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 + '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();
Object Safety§
This trait is not object safe.