Skip to main content

AsyncAggregateCreator

Trait AsyncAggregateCreator 

Source
pub trait AsyncAggregateCreator {
    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 create<'a, F>(
        &'a mut self,
        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 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 creates an aggregate from a command and runs the lifecycle callback.

日本語:
コマンドから集約を非同期に作成し、ライフサイクルコールバックを実行します。

Required Associated Types§

Required Methods§

Source

fn create<'a, F>( &'a mut self, 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 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§