Trait fmodel_rust::aggregate::StateRepository
source · pub trait StateRepository<C, S, Version, Error> {
// Required methods
fn fetch_state<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Option<(S, Version)>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 S,
version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<(S, Version), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
State Repository trait
Generic parameters:
C
- CommandS
- StateVersion
- VersionError
- Error
Required Methods§
sourcefn fetch_state<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Option<(S, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_state<'life0, 'life1, 'async_trait>(
&'life0 self,
command: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<Option<(S, Version)>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches current state, based on the command.
sourcefn save<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 S,
version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<(S, 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,
state: &'life1 S,
version: &'life2 Option<Version>
) -> Pin<Box<dyn Future<Output = Result<(S, Version), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Saves state.