Trait cqrs_eventsourcing::Store[][src]

pub trait Store<A, E>: Clone + Sync + Send where
    A: Aggregate,
    E: DomainEvent<A>, 
{ #[must_use] fn assemble_aggregate<'life0, 'async_trait>(
        &'life0 self,
        id: Option<String>
    ) -> Pin<Box<dyn Future<Output = Result<AggregateContext<A>, Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn append<'life0, 'async_trait>(
        &'life0 self,
        events: Vec<E>,
        context: AggregateContext<A>,
        meta: MetaData
    ) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn retrieve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        aggregate_id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn retrieve_for_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        aggregate_id: Option<&'life1 str>
    ) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Required methods

#[must_use]fn assemble_aggregate<'life0, 'async_trait>(
    &'life0 self,
    id: Option<String>
) -> Pin<Box<dyn Future<Output = Result<AggregateContext<A>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Rebuilding the aggregate

#[must_use]fn append<'life0, 'async_trait>(
    &'life0 self,
    events: Vec<E>,
    context: AggregateContext<A>,
    meta: MetaData
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Append formated events to store

#[must_use]fn retrieve<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: &'life1 str
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for command store

#[must_use]fn retrieve_for_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for query

Loading content...

Implementors

impl<A: Aggregate, E: DomainEvent<A>> Store<A, E> for FileEventStore<A, E>[src]

fn assemble_aggregate<'life0, 'async_trait>(
    &'life0 self,
    id: Option<String>
) -> Pin<Box<dyn Future<Output = Result<AggregateContext<A>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Rebuilding the aggregate

fn append<'life0, 'async_trait>(
    &'life0 self,
    events: Vec<E>,
    context: AggregateContext<A>,
    meta: MetaData
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Append formated events to store

fn retrieve<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: &'life1 str
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for command store

fn retrieve_for_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for query

impl<A: Aggregate, E: DomainEvent<A>> Store<A, E> for TestStore<A, E>[src]

fn assemble_aggregate<'life0, 'async_trait>(
    &'life0 self,
    id: Option<String>
) -> Pin<Box<dyn Future<Output = Result<AggregateContext<A>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Rebuilding the aggregate

fn append<'life0, 'async_trait>(
    &'life0 self,
    events: Vec<E>,
    context: AggregateContext<A>,
    meta: MetaData
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Append formated events to store

fn retrieve<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: &'life1 str
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for command store

fn retrieve_for_query<'life0, 'life1, 'async_trait>(
    &'life0 self,
    aggregate_id: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = FormatedResult<A, E>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Retrive Events for query

Loading content...