pub struct PostgresSnapshotStoreAggregateContext<A>where
A: Aggregate,{
pub aggregate_id: String,
pub current_sequence: usize,
/* private fields */
}
Expand description
Holds context for a pure event store implementation for MemStore
Fields§
§aggregate_id: String
The aggregate ID of the aggregate instance that has been loaded.
current_sequence: usize
The last committed event sequence number for this aggregate instance.
Implementations§
Source§impl<A> PostgresSnapshotStoreAggregateContext<A>where
A: Aggregate,
impl<A> PostgresSnapshotStoreAggregateContext<A>where
A: Aggregate,
Sourcepub fn new(
aggregate_id: String,
aggregate: A,
current_sequence: usize,
) -> PostgresSnapshotStoreAggregateContext<A>
pub fn new( aggregate_id: String, aggregate: A, current_sequence: usize, ) -> PostgresSnapshotStoreAggregateContext<A>
creates a new instance
Trait Implementations§
Source§impl<A> AggregateContext<A> for PostgresSnapshotStoreAggregateContext<A>where
A: Aggregate,
impl<A> AggregateContext<A> for PostgresSnapshotStoreAggregateContext<A>where
A: Aggregate,
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 PostgresSnapshotStoreAggregateContext<A>where
A: Freeze,
impl<A> RefUnwindSafe for PostgresSnapshotStoreAggregateContext<A>where
A: RefUnwindSafe,
impl<A> Send for PostgresSnapshotStoreAggregateContext<A>
impl<A> Sync for PostgresSnapshotStoreAggregateContext<A>
impl<A> Unpin for PostgresSnapshotStoreAggregateContext<A>where
A: Unpin,
impl<A> UnwindSafe for PostgresSnapshotStoreAggregateContext<A>where
A: UnwindSafe,
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