Skip to main content

EventConsumer

Trait EventConsumer 

Source
pub trait EventConsumer {
    type Event: DomainEvent;
    type Error;

    // Required method
    fn consume(&mut self, event: &Self::Event) -> Result<(), Self::Error>;
}
Expand description

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§

Source

type Event: DomainEvent

English:
Domain event accepted by this consumer.

日本語:
このコンシューマーが受け付けるドメインイベントです。

Source

type Error

English:
Failure reported by the consuming implementation.

日本語:
処理の実装が報告する失敗です。

Required Methods§

Source

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".

Implementors§