Struct persist_es::PersistedSnapshotStore[][src]

pub struct PersistedSnapshotStore<R, SR, A> where
    R: PersistedEventRepository<A>,
    SR: PersistedSnapshotEventRepository<A>,
    A: Aggregate + Send + Sync
{ /* fields omitted */ }
Expand description

Storage engine using a database backing. This is an snapshot-sourced EventStore, meaning it uses the serialized aggregate as the primary source of truth for the state of the aggregate.

The individual events are also persisted but are used only for updating queries.

For a event-sourced EventStore see PersistedEventStore.

Implementations

Creates a new PostgresSnapshotStore from the provided database connection pool, an EventStore used for configuring a new cqrs framework.

let store = PostgresSnapshotStore::<MyAggregate>::new(pool);
let cqrs = CqrsFramework::new(store, vec![]);

Trait Implementations

Provides the current state of an aggregate along with surrounding context. This is used by the CqrsFramework when loading an aggregate in order to handle incoming commands. Read more

Load all events for a particular aggregate_id

Load aggregate at current state

Commit new events

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.