pub struct PostgresSnapshotStore<A: Aggregate> { /* private fields */ }
Expand description
Storage engine using an Postgres backing and relying on a serialization of the aggregate rather than individual events. This is similar to the “snapshot strategy” seen in many CQRS frameworks.
Implementations§
Trait Implementations§
Source§impl<A: Aggregate> EventStore<A, PostgresSnapshotStoreAggregateContext<A>> for PostgresSnapshotStore<A>
impl<A: Aggregate> EventStore<A, PostgresSnapshotStoreAggregateContext<A>> for PostgresSnapshotStore<A>
Source§fn load(&mut self, aggregate_id: &str) -> Vec<EventEnvelope<A>>
fn load(&mut self, aggregate_id: &str) -> Vec<EventEnvelope<A>>
Load all events for a particular
aggregate_id
Source§fn load_aggregate(
&mut self,
aggregate_id: &str,
) -> PostgresSnapshotStoreAggregateContext<A>
fn load_aggregate( &mut self, aggregate_id: &str, ) -> PostgresSnapshotStoreAggregateContext<A>
Load aggregate at current state
Source§fn commit(
&mut self,
events: Vec<A::Event>,
context: PostgresSnapshotStoreAggregateContext<A>,
metadata: HashMap<String, String>,
) -> Result<Vec<EventEnvelope<A>>, AggregateError>
fn commit( &mut self, events: Vec<A::Event>, context: PostgresSnapshotStoreAggregateContext<A>, metadata: HashMap<String, String>, ) -> Result<Vec<EventEnvelope<A>>, AggregateError>
Commit new events
Auto Trait Implementations§
impl<A> !Freeze for PostgresSnapshotStore<A>
impl<A> !RefUnwindSafe for PostgresSnapshotStore<A>
impl<A> Send for PostgresSnapshotStore<A>
impl<A> !Sync for PostgresSnapshotStore<A>
impl<A> Unpin for PostgresSnapshotStore<A>where
A: Unpin,
impl<A> !UnwindSafe for PostgresSnapshotStore<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more