Trait CommReducer

Source
pub trait CommReducer {
    type Update;

    // Required method
    fn reduce(
        &self,
        left: Self::Update,
        right: Self::Update,
    ) -> Result<Self::Update>;
}
Expand description

Commutative reducer for an accumulator. This is used to coallesce updates. For example, if the accumulator is a sum, its reducer calculates and returns the sum of 2 updates. This is helpful in split ports, where a large number of updates can be reduced into a smaller number of updates before being sent to the parent port.

Required Associated Types§

Source

type Update

The type of updates to be reduced.

Required Methods§

Source

fn reduce( &self, left: Self::Update, right: Self::Update, ) -> Result<Self::Update>

Reduce 2 updates into a single update.

Implementors§