pub trait Identifiers<G: Scope, D: ExchangeData, R: ExchangeData + Abelian> {
// Required method
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
use differential_dataflow::input::Input;
use differential_dataflow::algorithms::identifiers::Identifiers;
use differential_dataflow::operators::Threshold;
::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 { *cnt } else { 0 })
.assert_empty();
});