Reducer

Trait Reducer 

Source
pub trait Reducer<T, U> {
    // Required method
    fn apply(&self, acc: U, value: &T) -> U;
}
Expand description

Trait for types that can be used as reducer functions.

Required Methods§

Source

fn apply(&self, acc: U, value: &T) -> U

Apply the reducer to the accumulator and value.

Implementors§

Source§

impl<T, U, F> Reducer<T, U> for F
where F: Fn(U, &T) -> U,