pub struct EventStore<A: IAggregate> { /* private fields */ }Expand description
Storage engine using an Postgres backing. This is the only persistent store currently provided.
Implementations§
Source§impl<A: IAggregate> EventStore<A>
impl<A: IAggregate> EventStore<A>
Trait Implementations§
Source§impl<A: IAggregate> IEventStore<A> for EventStore<A>
impl<A: IAggregate> IEventStore<A> for EventStore<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_idSource§fn load_aggregate(&mut self, aggregate_id: &str) -> AggregateContext<A>
fn load_aggregate(&mut self, aggregate_id: &str) -> AggregateContext<A>
Load aggregate at current state
Source§fn commit(
&mut self,
events: Vec<A::Event>,
context: AggregateContext<A>,
metadata: HashMap<String, String>,
) -> Result<Vec<EventEnvelope<A>>, AggregateError>
fn commit( &mut self, events: Vec<A::Event>, context: AggregateContext<A>, metadata: HashMap<String, String>, ) -> Result<Vec<EventEnvelope<A>>, AggregateError>
Commit new events
Source§fn wrap_events(
&self,
aggregate_id: &str,
current_sequence: usize,
resultant_events: Vec<<A as IAggregate>::Event>,
base_metadata: HashMap<String, String>,
) -> Vec<EventEnvelope<A>>
fn wrap_events( &self, aggregate_id: &str, current_sequence: usize, resultant_events: Vec<<A as IAggregate>::Event>, base_metadata: HashMap<String, String>, ) -> Vec<EventEnvelope<A>>
Method to wrap a set of events with the additional metadata
needed for persistence and publishing
Auto Trait Implementations§
impl<A> !Freeze for EventStore<A>
impl<A> !RefUnwindSafe for EventStore<A>
impl<A> Send for EventStore<A>
impl<A> !Sync for EventStore<A>
impl<A> Unpin for EventStore<A>where
A: Unpin,
impl<A> !UnwindSafe for EventStore<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