Skip to main content

Projection

Trait Projection 

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

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

English:
Applies domain events to a read model synchronously.

Storage, event ordering, idempotency, and panic conditions belong to the implementation; this trait does not replay or persist events itself.

日本語:
ドメインイベントを読み取りモデルへ同期的に適用します。

保存方法、イベント順序、冪等性、パニック条件は実装が定めます。 このトレイト自体はイベントの再生や永続化を行いません。

Required Associated Types§

Source

type Event: DomainEvent

English:
Event type used to update the read model.

日本語:
読み取りモデルの更新に使うイベント型です。

Source

type Error

English:
Failure produced while updating the projection.

日本語:
プロジェクションの更新中に生じる失敗です。

Required Methods§

Source

fn project(&mut self, event: &Self::Event) -> Result<(), Self::Error>

English:
Updates the projection from event or returns an implementation error. Rollback of partial updates is not specified by this signature.

日本語:
event からプロジェクションを更新するか、実装のエラーを返します。 部分的な更新のロールバックは、このシグネチャでは規定しません。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§