Skip to main content

Reducer

Trait Reducer 

Source
pub trait Reducer<A>
where A: Clone + Send + 'static, Self: Sized,
{ // Required method fn reduce(&mut self, action: A) -> Vec<A>; }
Expand description

State reducer.

§Abstraction Goals

  • Separation of concerns: This is only intended to apply actions ot state.
  • Make state changes trivialy testable.
  • Deterministic state changes.
  • Deterministic observe changes of interest (retuned actions).

Required Methods§

Source

fn reduce(&mut self, action: A) -> Vec<A>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§