Skip to main content

Grouping

Trait Grouping 

Source
pub trait Grouping {
    // Required methods
    fn len(&self) -> usize;
    fn fold<T, R>(&self, data: &[T]) -> (Vec<<R as Reduction<T>>::Total>, bool)
       where T: Copy,
             R: Reduction<T>;
    fn scan<T, R>(&self, data: &[T]) -> (Vec<<R as Reduction<T>>::Total>, bool)
       where T: Copy,
             R: Reduction<T>;
}
Expand description

A grouping of a vector’s items that a fold totals, or a scan runs, each on its own: classes by number (ClassNumbers), or ranges of positions (Ranges), as a segmented array’s items are ranges of its leaf.

Required Methods§

Source

fn len(&self) -> usize

The number of groups.

Source

fn fold<T, R>(&self, data: &[T]) -> (Vec<<R as Reduction<T>>::Total>, bool)
where T: Copy, R: Reduction<T>,

Folds each group of data by R, and whether every fold fits.

Source

fn scan<T, R>(&self, data: &[T]) -> (Vec<<R as Reduction<T>>::Total>, bool)
where T: Copy, R: Reduction<T>,

Scans each group of data by R: every item’s running total within its group, the groups one after another in group order, each in its items’ order, and whether every total fits.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Grouping for Ranges<'_>

Source§

impl<N> Grouping for ClassNumbers<'_, N>
where N: Key,