AggregateExt

Trait AggregateExt 

Source
pub trait AggregateExt: Aggregate {
    // Provided method
    fn fold<I>(
        state: Self::State,
        events: I,
    ) -> Result<Self::State, Self::Error>
       where I: Iterator<Item = Self::Event> { ... }
}
Expand description

Extension trait with some handy methods to use with Aggregates.

Provided Methods§

Source

fn fold<I>(state: Self::State, events: I) -> Result<Self::State, Self::Error>
where I: Iterator<Item = Self::Event>,

Applies a list of Events from an Iterator to the current Aggregate State.

Useful to recreate the State of an Aggregate when the Events are located in-memory.

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§

Source§

impl<T> AggregateExt for T
where T: Aggregate,