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§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<T> CommReducer for ValueOverlayReducer<T>
Reducer for sparse overlay updates.
impl<T> CommReducer for ValueOverlayReducer<T>
Reducer for sparse overlay updates.
Combines two ValueOverlay<T> updates using right-wins
semantics: overlapping runs from right overwrite those in
left. The merged runs are then normalized and validated via
ValueOverlay::try_from_runs.
Used by the corresponding Accumulator to perform distributed
reduction of incremental mesh updates.