Trait fmodel_rust::aggregate::EventRepository
source · pub trait EventRepository<C, E, Version, Error> {
// Required methods
fn fetch_events<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
events: &'life1 [E],
latest_version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Event Repository trait
Generic parameters:
C
- CommandE
- EventVersion
- Version/Offset/Sequence numberError
- Error
Required Methods§
sourcefn fetch_events<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_events<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches current events, based on the command.
sourcefn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
events: &'life1 [E],
latest_version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
events: &'life1 [E],
latest_version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<Vec<(E, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Saves events.