Trait cqrs_es2::EventStore[][src]

pub trait EventStore<A, AC> where
    A: Aggregate,
    AC: AggregateContext<A>, 
{ fn load(&mut self, aggregate_id: &str) -> Vec<EventEnvelope<A>>;
fn load_aggregate(&mut self, aggregate_id: &str) -> AC;
fn commit(
        &mut self,
        events: Vec<A::Event>,
        context: AC,
        metadata: HashMap<String, String>
    ) -> Result<Vec<EventEnvelope<A>>, AggregateError>; fn wrap_events(
        &self,
        aggregate_id: &str,
        current_sequence: usize,
        resultant_events: Vec<A::Event>,
        base_metadata: HashMap<String, String>
    ) -> Vec<EventEnvelope<A>> { ... } }
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