pub trait AggregateState<E>: Default {
// Required method
fn apply_event(self, event: E) -> Self;
}Expand description
A trait representing the state of an aggregate that can be modified by applying events.
§Type Parameters
E- The type of events that can be applied to the state.
Required Methods§
Sourcefn apply_event(self, event: E) -> Self
fn apply_event(self, event: E) -> Self
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§
impl<E> AggregateState<E> for Stateless
Implementation of the AggregateState trait for the Stateless struct.
This implementation does not modify the state when an event is applied.