Skip to main content

CountTotal

Trait CountTotal 

Source
pub trait CountTotal<'scope, T: Timestamp + TotalOrder + Lattice + Ord, K: ExchangeData, R: Semigroup>: Sized {
    // Required method
    fn count_total_core<R2: Semigroup + From<i8> + 'static>(
        self,
    ) -> VecCollection<'scope, T, (K, R), R2>;

    // Provided method
    fn count_total(self) -> VecCollection<'scope, T, (K, R), isize> { ... }
}
Expand description

Extension trait for the count differential dataflow method.

Required Methods§

Source

fn count_total_core<R2: Semigroup + From<i8> + 'static>( self, ) -> VecCollection<'scope, T, (K, R), R2>

Count for general integer differences.

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

Provided Methods§

Source

fn count_total(self) -> VecCollection<'scope, T, (K, R), isize>

Counts the number of occurrences of each element.

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

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

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<'scope, K, Tr> CountTotal<'scope, <Tr as LayoutExt>::Time, K, <Tr as LayoutExt>::Diff> for Arranged<'scope, Tr>
where Tr: for<'a> TraceReader<Key<'a> = &'a K, Val<'a> = &'a (), Time: TotalOrder, Diff: ExchangeData + Semigroup<Tr::DiffGat<'a>>> + Clone + 'static, K: ExchangeData,

Source§

impl<'scope, T, K: ExchangeData + Hashable, R: ExchangeData + Semigroup> CountTotal<'scope, T, K, R> for VecCollection<'scope, T, K, R>