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
Required Methods
fn reduce(&mut self, state: Self::State, item: &Self::Item) -> Self::State
Takes current state, item and returns new state
Provided Methods
fn chain<R: Reducer<State = Self::State, Item = Self::Item>>(
self,
other: R
) -> ChainedReducer<Self, R>
self,
other: R
) -> ChainedReducer<Self, R>
Chains two reducers together sequentially