Skip to main content

AsyncProjection

Trait AsyncProjection 

Source
pub trait AsyncProjection {
    type Event: DomainEvent + Sync;
    type Error: Send;

    // Required method
    fn project<'a>(
        &'a mut self,
        event: &'a Self::Event,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'a>>;
}
Expand description

English:
Updates a read model through boxed, Send futures.

The future holds a mutable projection borrow and a shared event borrow for 'a. Implementations define persistence, ordering, duplicate handling, panics, and cancellation behavior; this trait adds no scheduling or locking.

日本語:
ボックス化された Send Future を通じて読み取りモデルを更新します。

Future はプロジェクションの可変借用とイベントの共有借用を 'a の間保持します。 永続化、順序、重複の扱い、パニック、キャンセル時の挙動は実装が定めます。 このトレイトはスケジューリングやロックを追加しません。

Required Associated Types§

Source

type Event: DomainEvent + Sync

English:
Read-model input event with thread-shareable references.

日本語:
スレッド間で参照を共有できる読み取りモデルの入力イベントです。

Source

type Error: Send

English:
Projection update error transferable across threads.

日本語:
スレッド間で受け渡せるプロジェクション更新エラーです。

Required Methods§

Source

fn project<'a>( &'a mut self, event: &'a Self::Event, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'a>>

English:
Returns a future applying event and reporting completion or an update error. Neither an error nor dropping the future guarantees that partial updates were undone.

日本語:
event を適用し、完了または更新エラーを報告する Future を返します。 エラーや Future の破棄は、部分的な更新の取り消しを保証しません。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§