[][src]Trait riker_es::ES

pub trait ES: Debug + Send + Sync + 'static {
    type Args: ActorArgs;
    type Agg: Aggregate;
    type Cmd: Message;
    type Event: Message;
    type Error: Debug;
    fn new(cx: &Context<CQRS<Self::Cmd>>, args: Self::Args) -> Self;

#[must_use]    fn handle_command<'life0, 'async_trait>(
        &'life0 mut self,
        _cmd: Self::Cmd,
        _store: StoreRef<Self::Agg>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] fn handle_event<'life0, 'async_trait>(
        &'life0 mut self,
        _event: Self::Event,
        _store: StoreRef<Self::Agg>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }

Implement this trait to allow your entity handle external commands

Associated Types

Loading content...

Required methods

fn new(cx: &Context<CQRS<Self::Cmd>>, args: Self::Args) -> Self

Loading content...

Provided methods

#[must_use]fn handle_command<'life0, 'async_trait>(
    &'life0 mut self,
    _cmd: Self::Cmd,
    _store: StoreRef<Self::Agg>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn handle_event<'life0, 'async_trait>(
    &'life0 mut self,
    _event: Self::Event,
    _store: StoreRef<Self::Agg>
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

Loading content...