Skip to main content

CommandHandler

Trait CommandHandler 

Source
pub trait CommandHandler: Aggregate {
    type CreateCommand: DeserializeOwned + MaybeSync + MaybeSend;
    type UpdateCommand: DeserializeOwned + MaybeSync + MaybeSend;
    type Services: MaybeSend + MaybeSync;

    // Required methods
    fn handle_create<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        command: Self::CreateCommand,
        services: &'life1 Self::Services,
        context: &'life2 CqrsContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Event>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn handle_update<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        command: Self::UpdateCommand,
        services: &'life1 Self::Services,
        context: &'life2 CqrsContext,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Event>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}

Required Associated Types§

Required Methods§

Source

fn handle_create<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, command: Self::CreateCommand, services: &'life1 Self::Services, context: &'life2 CqrsContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Event>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn handle_update<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, command: Self::UpdateCommand, services: &'life1 Self::Services, context: &'life2 CqrsContext, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::Event>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§