pub trait Identifiers<G: Scope, D: Data, R: Diff> {
fn identifiers(&self) -> Collection<G, (D, u64), R>;
}Expand description
Assign unique identifiers to elements of a collection.
Required Methods
sourcefn identifiers(&self) -> Collection<G, (D, u64), R>
fn identifiers(&self) -> Collection<G, (D, u64), R>
Assign unique identifiers to elements of a collection.
Example
extern crate timely;
extern crate differential_dataflow;
use differential_dataflow::input::Input;
use differential_dataflow::algorithms::identifiers::Identifiers;
use differential_dataflow::operators::Threshold;
fn main() {
::timely::example(|scope| {
let identifiers =
scope.new_collection_from(1 .. 10).1
.identifiers()
// assert no conflicts
.map(|(data, id)| id)
.threshold(|_id,cnt| if cnt > 1 { 1 } else { 0 })
.assert_empty();
});
}