[][src]Trait riker_es::ES

pub trait ES: Debug + Send + Sync + 'static {
    type Args: ActorArgs;
    type Agg: Aggregate;
    type Cmd: Message;
    type Event: Message;
    fn new(cx: &Context<CQRS<Self::Cmd, Self::Event>>, args: Self::Args) -> Self;
#[must_use] fn handle_command<'life0, 'async_trait, Ctx: Sys>(
        &'life0 self,
        cmd: Self::Cmd,
        ctx: Ctx,
        store: StoreRef<Self::Agg>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        Ctx: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; #[must_use] fn handle_event<'life0, 'async_trait, Ctx: Sys>(
        &'life0 self,
        _event: Self::Event,
        _ctx: Ctx,
        _store: StoreRef<Self::Agg>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        Ctx: 'async_trait,
        '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, Self::Event>>, args: Self::Args) -> Self

#[must_use]fn handle_command<'life0, 'async_trait, Ctx: Sys>(
    &'life0 self,
    cmd: Self::Cmd,
    ctx: Ctx,
    store: StoreRef<Self::Agg>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    Ctx: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 

Loading content...

Provided methods

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

Loading content...

Implementors

Loading content...