Trait cqrs_es2::IEventStore[][src]

pub trait IEventStore<C: ICommand, E: IEvent, A: IAggregate<C, E>> {
    fn load_events(
        &mut self,
        aggregate_id: &str,
        with_metadata: bool
    ) -> Result<Vec<EventContext<C, E>>, AggregateError>;
fn load_aggregate(
        &mut self,
        aggregate_id: &str
    ) -> Result<AggregateContext<C, E, A>, AggregateError>;
fn commit(
        &mut self,
        events: Vec<E>,
        context: AggregateContext<C, E, A>,
        metadata: HashMap<String, String>
    ) -> Result<Vec<EventContext<C, E>>, AggregateError>; fn wrap_events(
        &self,
        aggregate_id: &str,
        current_sequence: usize,
        events: Vec<E>,
        metadata: HashMap<String, String>
    ) -> Vec<EventContext<C, E>> { ... } }
Expand description

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

Required methods

Load all events for a particular aggregate_id

Load aggregate at current state

Commit new events

Provided methods

Method to wrap a set of events with the additional metadata needed for persistence and publishing

Implementors