pub trait Reducer<Index, ReducedIndex = Index>: Debug + Clone + Send + Sync {
    fn reduce<'a, Indexes, IndexesIter>(&self, indexes: Indexes) -> ReducedIndex
    where
        Index: 'a,
        Indexes: IntoIterator<Item = &'a Index, IntoIter = IndexesIter> + ExactSizeIterator,
        IndexesIter: Iterator<Item = &'a Index> + ExactSizeIterator + Clone
;
fn rereduce<'a, ReducedIndexes, ReducedIndexesIter>(
        &self,
        values: ReducedIndexes
    ) -> ReducedIndex
    where
        Self: 'a,
        ReducedIndex: 'a,
        ReducedIndexes: IntoIterator<Item = &'a ReducedIndex, IntoIter = ReducedIndexesIter> + ExactSizeIterator,
        ReducedIndexesIter: Iterator<Item = &'a ReducedIndex> + ExactSizeIterator + Clone
; }
Expand description

Reduces one or more Indexes or instances of Self into a single Self value.

This trait is used to collect statistics within the B-Tree. The Index value is stored at the KeyEntry level, and each Interior entry contains Self, which is calculated by calling Reducer::reduce() on all stored Indexes.

When an Interior node points to other interior nodes, it calculates the stored value by calling Reducer::rereduce() with all the stored Self values.

Required methods

Reduces one or more indexes into a single reduced index.

Reduces one or more previously-reduced indexes into a single reduced index.

Implementations on Foreign Types

Implementors