co_actor/state.rs
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 1io BRANDGUARDIAN GmbH
3
4/// State reducer.
5///
6/// # Abstraction Goals
7/// - Separation of concerns: This is only intended to apply actions ot state.
8/// - Make state changes trivialy testable.
9/// - Deterministic state changes.
10/// - Deterministic observe changes of interest (retuned actions).
11pub trait Reducer<A>
12where
13 A: Clone + Send + 'static,
14 Self: Sized,
15{
16 fn reduce(&mut self, action: A) -> Vec<A>;
17}