Trait cqrs_es2_store::IEventStore[][src]

pub trait IEventStore<C: ICommand, E: IEvent, A: IAggregate<C, E>> {
    fn save_events(
        &mut self,
        contexts: &Vec<EventContext<C, E>>
    ) -> Result<(), Error>;
fn load_events(
        &mut self,
        aggregate_id: &str
    ) -> Result<Vec<EventContext<C, E>>, Error>;
fn save_aggregate_snapshot(
        &mut self,
        context: AggregateContext<C, E, A>
    ) -> Result<(), Error>;
fn load_aggregate_from_snapshot(
        &mut self,
        aggregate_id: &str
    ) -> Result<AggregateContext<C, E, A>, Error>; }
Expand description

The abstract central source for loading past events and committing new events.

Required methods

Save new events

Load all events for a particular aggregate_id

save a new aggregate snapshot

Load aggregate at current state from snapshots

Implementors