[−][src]Trait krill::commons::eventsourcing::AggregateStore
Required methods
fn get_latest(&self, id: &Handle) -> Result<Arc<A>, AggregateStoreError>
Gets the latest version for the given aggregate. Returns an AggregateStoreError::UnknownAggregate in case the aggregate does not exist.
fn add(&self, init: A::InitEvent) -> Result<Arc<A>, AggregateStoreError>
Adds a new aggregate instance based on the init event.
fn command(&self, cmd: A::Command) -> Result<Arc<A>, A::Error>
Sends a command to the appropriate aggregate, and on success: save command and events, return aggregate no-op: do not save any thing, return aggregate error: save command and error, return error
fn has(&self, id: &Handle) -> bool
Returns true if an instance exists for the id
fn list(&self) -> Vec<Handle>
Lists all known ids.
fn add_listener<L: EventListener<A>>(&mut self, listener: Arc<L>)
Adds a listener that will receive a reference to all events as they are stored.
fn history(
&self,
id: &Handle
) -> Result<AggregateHistory<A>, AggregateStoreError>
&self,
id: &Handle
) -> Result<AggregateHistory<A>, AggregateStoreError>
Lists the complete history for an aggregate.
Implementors
impl<A: Aggregate> AggregateStore<A> for DiskAggregateStore<A> where
A::Error: From<AggregateStoreError>,
[src]
A::Error: From<AggregateStoreError>,
fn get_latest(&self, handle: &Handle) -> Result<Arc<A>, AggregateStoreError>
[src]
fn add(&self, init: A::InitEvent) -> Result<Arc<A>, AggregateStoreError>
[src]
fn command(&self, cmd: A::Command) -> Result<Arc<A>, A::Error>
[src]
fn has(&self, id: &Handle) -> bool
[src]
fn list(&self) -> Vec<Handle>
[src]
fn add_listener<L: EventListener<A>>(&mut self, listener: Arc<L>)
[src]
fn history(
&self,
id: &Handle
) -> Result<AggregateHistory<A>, AggregateStoreError>
[src]
&self,
id: &Handle
) -> Result<AggregateHistory<A>, AggregateStoreError>