Trait persist_es::PersistedEventRepository[][src]

pub trait PersistedEventRepository: Send + Sync {
    fn get_events<'life0, 'life1, 'async_trait, A: Aggregate>(
        &'life0 self,
        aggregate_id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SerializedEvent>, PersistenceError>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn get_last_events<'life0, 'life1, 'async_trait, A: Aggregate>(
        &'life0 self,
        aggregate_id: &'life1 str,
        number_events: usize
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SerializedEvent>, PersistenceError>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn get_snapshot<'life0, 'life1, 'async_trait, A: Aggregate>(
        &'life0 self,
        aggregate_id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Option<SerializedSnapshot>, PersistenceError>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn persist<'life0, 'life1, 'async_trait, A: Aggregate>(
        &'life0 self,
        events: &'life1 [SerializedEvent],
        snapshot_update: Option<(String, Value, usize)>
    ) -> Pin<Box<dyn Future<Output = Result<(), PersistenceError>> + Send + 'async_trait>>
    where
        A: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }
Expand description

Handles the database access needed for operation of a PersistedSnapshotStore.

Required methods

Returns all events for a single aggregate instance.

Returns the last events for a single aggregate instance.

Returns the current snapshot for an aggregate instance.

Commits the updated aggregate and accompanying events.

Implementors