Trait sit_core::reducers::Reducer [] [src]

pub trait Reducer: Sized {
    type State;
    type Item;
    fn reduce(&mut self, state: Self::State, item: &Self::Item) -> Self::State;

    fn chain<R: Reducer<State = Self::State, Item = Self::Item>>(
        self,
        other: R
    ) -> ChainedReducer<Self, R> { ... } }

Generic reducer trait

Associated Types

State type

Item type

Required Methods

Takes current state, item and returns new state

Provided Methods

Chains two reducers together sequentially

Implementors