Skip to main content

Reducer

Trait Reducer 

Source
pub trait Reducer<T>: Send + Sync {
    // Required method
    fn reduce(&self, current: &mut T, update: T);
}
Expand description

A strategy for merging an update: T into a current: &mut T.

Required Methods§

Source

fn reduce(&self, current: &mut T, update: T)

Merge update into current in place.

Implementors§

Source§

impl Reducer<Value> for Merge

Source§

impl<T> Reducer<T> for Add
where T: AddAssign + Send + Sync,

Source§

impl<T, F> Reducer<T> for Custom<F>
where T: Send + Sync, F: Fn(&mut T, T) + Send + Sync,

Source§

impl<T: Send + Sync> Reducer<Option<T>> for LastValue

Source§

impl<T: Send + Sync> Reducer<Vec<T>> for Append