pub trait Reducer {
type State;
type Action;
// Required method
fn reduce(
&self,
state: &mut Self::State,
action: Self::Action,
) -> Cmd<Self::Action>;
}Expand description
Composable update logic (UDF Reducer parity).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<S, A> Reducer for fn(&mut S, A) -> Cmd<A>
Blanket impl — existing update fn pointers are reducers (zero-cost hot path).
impl<S, A> Reducer for fn(&mut S, A) -> Cmd<A>
Blanket impl — existing update fn pointers are reducers (zero-cost hot path).