Struct persist_es::PersistedEventStore[][src]

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

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

For a snapshot-based EventStore see PersistedSnapshotStore.

Implementations

Creates a new PostgresStore from the provided event repository, an EventStore used for configuring a new cqrs framework.

let repo = ...
let store = PersistedEventStore::<MyAggregate>::new(repo);
let cqrs = CqrsFramework::new(store, vec![]);

Adds configures the store to use event upcasters on load. These should be placed in the order that they are applied.

E.g., an upcaster for version 0.2.3 should be placed before an upcaster for version 0.2.4

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.