[−][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 command_history(
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, AggregateStoreError>
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, AggregateStoreError>
Lists the history for an aggregate.
fn stored_command(
&self,
id: &Handle,
key: &CommandKey
) -> Result<Option<StoredCommand<A::StorableCommandDetails>>, AggregateStoreError>
&self,
id: &Handle,
key: &CommandKey
) -> Result<Option<StoredCommand<A::StorableCommandDetails>>, AggregateStoreError>
Returns a stored command if it can be found.
fn stored_event(
&self,
id: &Handle,
version: u64
) -> Result<Option<A::Event>, AggregateStoreError>
&self,
id: &Handle,
version: u64
) -> Result<Option<A::Event>, AggregateStoreError>
Returns a stored event if it can be found.
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 command_history(
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, AggregateStoreError>
[src]
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, AggregateStoreError>
fn stored_command(
&self,
id: &Handle,
key: &CommandKey
) -> Result<Option<StoredCommand<<A as Aggregate>::StorableCommandDetails>>, AggregateStoreError>
[src]
&self,
id: &Handle,
key: &CommandKey
) -> Result<Option<StoredCommand<<A as Aggregate>::StorableCommandDetails>>, AggregateStoreError>
fn stored_event(
&self,
id: &Handle,
version: u64
) -> Result<Option<<A as Aggregate>::Event>, AggregateStoreError>
[src]
&self,
id: &Handle,
version: u64
) -> Result<Option<<A as Aggregate>::Event>, AggregateStoreError>