[−][src]Trait differential_dataflow::input::Input
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,
&mut self
) -> (InputSession<Self::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
extern crate timely; extern crate differential_dataflow; use timely::Configuration; use differential_dataflow::input::Input; fn main() { ::timely::execute(Configuration::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,
&mut self,
data: I
) -> (InputSession<Self::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
extern crate timely; extern crate differential_dataflow; use timely::Configuration; use differential_dataflow::input::Input; fn main() { ::timely::execute(Configuration::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,
&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 from initial data.
Examples
extern crate timely; extern crate differential_dataflow; use timely::Configuration; use differential_dataflow::input::Input; fn main() { ::timely::execute(Configuration::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(); }
Implementors
impl<G: TimelyInput> Input for G where
<G as ScopeParent>::Timestamp: Lattice,
[src]
<G as ScopeParent>::Timestamp: Lattice,
fn new_collection<D, R>(
&mut self
) -> (InputSession<<G as ScopeParent>::Timestamp, D, R>, Collection<G, D, R>) where
D: Data,
R: Semigroup,
[src]
&mut self
) -> (InputSession<<G as ScopeParent>::Timestamp, D, R>, Collection<G, D, R>) where
D: Data,
R: Semigroup,
fn new_collection_from<I>(
&mut self,
data: I
) -> (InputSession<<G as ScopeParent>::Timestamp, I::Item, isize>, Collection<G, I::Item, isize>) where
I: IntoIterator + 'static,
I::Item: Data,
[src]
&mut self,
data: I
) -> (InputSession<<G as ScopeParent>::Timestamp, I::Item, isize>, Collection<G, I::Item, isize>) where
I: IntoIterator + 'static,
I::Item: Data,
fn new_collection_from_raw<D, R, I>(
&mut self,
data: I
) -> (InputSession<<G as ScopeParent>::Timestamp, D, R>, Collection<G, D, R>) where
D: Data,
R: Semigroup + Data,
I: IntoIterator<Item = (D, Self::Timestamp, R)> + 'static,
[src]
&mut self,
data: I
) -> (InputSession<<G as ScopeParent>::Timestamp, D, R>, Collection<G, D, R>) where
D: Data,
R: Semigroup + Data,
I: IntoIterator<Item = (D, Self::Timestamp, R)> + 'static,