Skip to main content

AsyncCommandHandler

Trait AsyncCommandHandler 

Source
pub trait AsyncCommandHandler {
    type Command;
    type Aggregate: AggregateRoot;
    type Repository: AsyncRepository<Aggregate = Self::Aggregate>;
    type Publisher: AsyncDomainEventPublisher<Event = <Self::Aggregate as AggregateRoot>::Event>;
    type Output;
    type Error;

    // Required method
    fn handle<'a, F>(
        &'a mut self,
        id: &'a <Self::Aggregate as Entity>::Id,
        command: Self::Command,
        callback: F,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'a>>
       where Self: Send + 'a,
             Self::Command: Send + 'a,
             Self::Aggregate: Send + 'a,
             <Self::Aggregate as Entity>::Id: Sync + 'a,
             <Self::Aggregate as AggregateRoot>::Event: Send + Sync + 'a,
             Self::Repository: Send + 'a,
             <Self::Repository as AsyncRepository>::Error: Send + 'a,
             Self::Publisher: Send + 'a,
             <Self::Publisher as AsyncDomainEventPublisher>::Error: Send + 'a,
             Self::Output: Send + 'a,
             Self::Error: From<LifecycleOperationError<<Self::Repository as AsyncRepository>::Error>> + From<LifecycleOperationError<<Self::Publisher as AsyncDomainEventPublisher>::Error>> + From<LifecycleCompletionError> + Send + 'a,
             F: AsyncLifecycleCallback<Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error> + Send + 'a;
}
Expand description

English:
Asynchronously handles a command against an aggregate using a lifecycle callback.

日本語:
ライフサイクルコールバックを使って集約に対するコマンドを非同期に処理します。

Required Associated Types§

Required Methods§

Source

fn handle<'a, F>( &'a mut self, id: &'a <Self::Aggregate as Entity>::Id, command: Self::Command, callback: F, ) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'a>>
where Self: Send + 'a, Self::Command: Send + 'a, Self::Aggregate: Send + 'a, <Self::Aggregate as Entity>::Id: Sync + 'a, <Self::Aggregate as AggregateRoot>::Event: Send + Sync + 'a, Self::Repository: Send + 'a, <Self::Repository as AsyncRepository>::Error: Send + 'a, Self::Publisher: Send + 'a, <Self::Publisher as AsyncDomainEventPublisher>::Error: Send + 'a, Self::Output: Send + 'a, Self::Error: From<LifecycleOperationError<<Self::Repository as AsyncRepository>::Error>> + From<LifecycleOperationError<<Self::Publisher as AsyncDomainEventPublisher>::Error>> + From<LifecycleCompletionError> + Send + 'a, F: AsyncLifecycleCallback<Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error> + Send + 'a,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§