pub trait Saver<T>: Send + Sync
where T: Aggregate,
{ // Required method fn save<'life0, 'life1, 'async_trait>( &'life0 self, root: &'life1 mut Root<T> ) -> Pin<Box<dyn Future<Output = Result<(), SaveError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; }
Expand description

Trait used to implement write access to a data store, which can be used to save the latest state of an aggregate::Root instance.

Required Methods§

source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, root: &'life1 mut Root<T> ) -> Pin<Box<dyn Future<Output = Result<(), SaveError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Saves a new version of an aggregate::Root instance to the data store.

Implementors§

source§

impl<T, Inner> Saver<T> for InstrumentedAggregateRepository<T, Inner>
where T: Aggregate + Debug, <T as Aggregate>::Id: Debug, <T as Aggregate>::Event: Debug, Inner: Repository<T>,

source§

impl<T, S> Saver<T> for EventSourced<T, S>
where T: Aggregate, T::Id: Clone, S: Store<T::Id, T::Event>,