differential_dataflow::operators::reduce

Trait Count

Source
pub trait Count<G: Scope, K: Data, R: Semigroup>
where G::Timestamp: Lattice + Ord,
{ // Required method fn count_core<R2: Ord + Abelian + From<i8> + 'static>( &self, ) -> Collection<G, (K, R), R2>; // Provided method fn count(&self) -> Collection<G, (K, R), isize> { ... } }
Expand description

Extension trait for the count differential dataflow method.

Required Methods§

Source

fn count_core<R2: Ord + Abelian + From<i8> + 'static>( &self, ) -> Collection<G, (K, R), R2>

Count for general integer differences.

This method allows count to produce collections whose difference type is something other than an isize integer, for example perhaps an i32.

Provided Methods§

Source

fn count(&self) -> Collection<G, (K, R), isize>

Counts the number of occurrences of each element.

§Examples
use differential_dataflow::input::Input;
use differential_dataflow::operators::Count;

::timely::example(|scope| {
    // report the number of occurrences of each key
    scope.new_collection_from(1 .. 10).1
         .map(|x| x / 3)
         .count();
});

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.

Implementors§

Source§

impl<G, K: Data, T1, R: Data + Semigroup> Count<G, K, R> for Arranged<G, T1>
where G: Scope<Timestamp = T1::Time>, T1: for<'a> TraceReader<Key<'a> = &'a K, Val<'a> = &'a (), Diff = R> + Clone + 'static, for<'a> T1::Key<'a>: IntoOwned<'a, Owned = K>,

Source§

impl<G: Scope, K: ExchangeData + Hashable, R: ExchangeData + Semigroup> Count<G, K, R> for Collection<G, K, R>
where G::Timestamp: Lattice + Ord,