pub struct PostgresStoreAggregateContext<A: Aggregate> {
pub aggregate_id: String,
pub aggregate: A,
pub current_sequence: usize,
}
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.
aggregate: A
The current state of the aggregate instance.
current_sequence: usize
The last committed event sequence number for this aggregate instance.
Trait Implementations§
Source§impl<A: Aggregate> AggregateContext<A> for PostgresStoreAggregateContext<A>
impl<A: Aggregate> AggregateContext<A> for PostgresStoreAggregateContext<A>
Source§impl<A: Aggregate> EventStore<A, PostgresStoreAggregateContext<A>> for PostgresStore<A>
impl<A: Aggregate> EventStore<A, PostgresStoreAggregateContext<A>> for PostgresStore<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,
) -> PostgresStoreAggregateContext<A>
fn load_aggregate( &mut self, aggregate_id: &str, ) -> PostgresStoreAggregateContext<A>
Load aggregate at current state
Source§fn commit(
&mut self,
events: Vec<A::Event>,
context: PostgresStoreAggregateContext<A>,
metadata: HashMap<String, String>,
) -> Result<Vec<EventEnvelope<A>>, AggregateError>
fn commit( &mut self, events: Vec<A::Event>, context: PostgresStoreAggregateContext<A>, metadata: HashMap<String, String>, ) -> Result<Vec<EventEnvelope<A>>, AggregateError>
Commit new events
Auto Trait Implementations§
impl<A> Freeze for PostgresStoreAggregateContext<A>where
A: Freeze,
impl<A> RefUnwindSafe for PostgresStoreAggregateContext<A>where
A: RefUnwindSafe,
impl<A> Send for PostgresStoreAggregateContext<A>
impl<A> Sync for PostgresStoreAggregateContext<A>
impl<A> Unpin for PostgresStoreAggregateContext<A>where
A: Unpin,
impl<A> UnwindSafe for PostgresStoreAggregateContext<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