Trait cqrs_es2::IQueryStore [−][src]
pub trait IQueryStore<C: ICommand, E: IEvent, A: IAggregate<C, E>, Q: IQuery<C, E>>: IEventDispatcher<C, E> { fn load(
&mut self,
aggregate_id: &str
) -> Result<QueryContext<C, E, Q>, AggregateError>; fn commit(
&mut self,
context: QueryContext<C, E, Q>
) -> Result<(), AggregateError>; fn dispatch_events(
&mut self,
aggregate_id: &str,
events: &[EventContext<C, E>]
) -> Result<(), AggregateError> { ... } }
Expand description
The abstract central source for loading and committing queries.
Required methods
fn load(
&mut self,
aggregate_id: &str
) -> Result<QueryContext<C, E, Q>, AggregateError>
fn load(
&mut self,
aggregate_id: &str
) -> Result<QueryContext<C, E, Q>, AggregateError>
loads the query
fn commit(
&mut self,
context: QueryContext<C, E, Q>
) -> Result<(), AggregateError>
fn commit(
&mut self,
context: QueryContext<C, E, Q>
) -> Result<(), AggregateError>
commits the query
Provided methods
fn dispatch_events(
&mut self,
aggregate_id: &str,
events: &[EventContext<C, E>]
) -> Result<(), AggregateError>
fn dispatch_events(
&mut self,
aggregate_id: &str,
events: &[EventContext<C, E>]
) -> Result<(), AggregateError>
used as a default implementation for dispatching