pub trait EventConsumer {
type Event: DomainEvent;
type Error;
// Required method
fn consume(&mut self, event: &Self::Event) -> Result<(), Self::Error>;
}Expand description
English: Exposes core 0.4’s domain, persistence, and event-workflow API.
日本語: コア 0.4 のドメイン、永続化、イベント処理 API を公開します。 English: Exposes synchronous event consumption and projection update contracts.
日本語: 同期イベント処理とプロジェクション更新の契約を公開します。 English: Handles a borrowed domain event synchronously.
Implementations define side effects, error and panic conditions, and duplicate handling. This port supplies no acknowledgement, retry, ordering, or deduplication mechanism.
日本語: 借用したドメインイベントを同期的に処理します。
副作用、エラーとパニックの条件、重複の扱いは実装が定めます。 このポートは確認応答、再試行、順序制御、重複排除の機構を提供しません。
Required Associated Types§
Sourcetype Event: DomainEvent
type Event: DomainEvent
English: Domain event accepted by this consumer.
日本語: このコンシューマーが受け付けるドメインイベントです。
Required Methods§
Sourcefn consume(&mut self, event: &Self::Event) -> Result<(), Self::Error>
fn consume(&mut self, event: &Self::Event) -> Result<(), Self::Error>
English: Processes event, returning Ok(()) on completion or the handler’s error.
An error does not imply that earlier side effects were rolled back.
日本語: event を処理し、完了時に Ok(())、失敗時にハンドラーのエラーを返します。
エラーは、それ以前の副作用のロールバックを意味しません。
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".