pub trait CommandHandler {
type Command;
type Aggregate: AggregateRoot;
type Repository: Repository<Aggregate = Self::Aggregate>;
type Publisher: DomainEventPublisher<Event = <Self::Aggregate as AggregateRoot>::Event>;
type Output;
type Error;
// Required method
fn handle<F>(
&mut self,
id: &<Self::Aggregate as Entity>::Id,
command: Self::Command,
callback: F,
) -> Result<Self::Output, Self::Error>
where F: for<'a> LifecycleCallback<'a, Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error>,
Self::Error: From<LifecycleOperationError<<Self::Repository as Repository>::Error>> + From<LifecycleOperationError<<Self::Publisher as DomainEventPublisher>::Error>> + From<LifecycleCompletionError>;
}Expand description
English: Exposes core 0.4’s domain, persistence, and event-workflow API.
日本語: コア 0.4 のドメイン、永続化、イベント処理 API を公開します。 English: Re-exports synchronous and asynchronous CQRS handlers, aggregate creators, and lifecycle APIs.
日本語: 同期・非同期の CQRS ハンドラー、集約作成器、ライフサイクル API を再エクスポートします。 English: Re-exports synchronous command and query handlers, aggregate creators, lifecycle callbacks, and the context coordinating aggregate saves and event dispatch.
日本語: 同期のコマンド・クエリハンドラー、集約作成器、ライフサイクルコールバック、 集約保存とイベント配信を調整するコンテキストを再エクスポートします。 English: Loads an aggregate for a command, runs its lifecycle callback, and returns the callback output or an error.
日本語: コマンド対象の集約を読み込み、ライフサイクルコールバックを実行し、その出力またはエラーを返します。
Required Associated Types§
type Command
type Aggregate: AggregateRoot
type Repository: Repository<Aggregate = Self::Aggregate>
type Publisher: DomainEventPublisher<Event = <Self::Aggregate as AggregateRoot>::Event>
type Output
type Error
Required Methods§
fn handle<F>(
&mut self,
id: &<Self::Aggregate as Entity>::Id,
command: Self::Command,
callback: F,
) -> Result<Self::Output, Self::Error>where
F: for<'a> LifecycleCallback<'a, Self::Aggregate, Self::Repository, Self::Publisher, Output = Self::Output, Error = Self::Error>,
Self::Error: From<LifecycleOperationError<<Self::Repository as Repository>::Error>> + From<LifecycleOperationError<<Self::Publisher as DomainEventPublisher>::Error>> + From<LifecycleCompletionError>,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".