pub struct AsyncLifecycleContext<'storage, A, R, P>where
A: AggregateRoot + Send + 'storage,
R: AsyncRepository<Aggregate = A> + Send + 'storage,
P: AsyncDomainEventPublisher<Event = A::Event> + Send + 'storage,
A::Event: Send + Sync + 'storage,
R::Error: Send + 'storage,
P::Error: Send + 'storage,{ /* private fields */ }Expand description
English: Re-exports synchronous and asynchronous CQRS handlers, aggregate creators, and lifecycle APIs.
日本語: 同期・非同期の CQRS ハンドラー、集約作成器、ライフサイクル API を再エクスポートします。 English: Re-exports asynchronous command and query handlers, aggregate creators, lifecycle callbacks, and the context coordinating persistence and event dispatch.
日本語: 非同期のコマンド・クエリハンドラー、集約作成器、ライフサイクルコールバック、 永続化とイベント配信を調整するコンテキストを再エクスポートします。 English: Re-exports synchronous and asynchronous CQRS handlers, aggregate creators, and lifecycle APIs.
日本語: 同期・非同期の CQRS ハンドラー、集約作成器、ライフサイクル API を再エクスポートします。 English: Re-exports asynchronous command and query handlers, aggregate creators, lifecycle callbacks, and the context coordinating persistence and event dispatch.
日本語: 非同期のコマンド・クエリハンドラー、集約作成器、ライフサイクルコールバック、 永続化とイベント配信を調整するコンテキストを再エクスポートします。 English: Re-exports synchronous and asynchronous CQRS handlers, aggregate creators, and lifecycle APIs.
日本語: 同期・非同期の CQRS ハンドラー、集約作成器、ライフサイクル API を再エクスポートします。 English: Re-exports asynchronous command and query handlers, aggregate creators, lifecycle callbacks, and the context coordinating persistence and event dispatch.
日本語: 非同期のコマンド・クエリハンドラー、集約作成器、ライフサイクルコールバック、 永続化とイベント配信を調整するコンテキストを再エクスポートします。 English: Coordinates asynchronous aggregate persistence and event dispatch. Each operation may be attempted once; dropping an in-progress future consumes that attempt.
日本語: 非同期の集約永続化とイベント配信を調整します。各操作は一度だけ試行でき、実行中の future を破棄すると試行は消費済みになります。
Implementations§
Source§impl<'storage, A, R, P> AsyncLifecycleContext<'storage, A, R, P>where
A: AggregateRoot + Send + 'storage,
R: AsyncRepository<Aggregate = A> + Send + 'storage,
P: AsyncDomainEventPublisher<Event = A::Event> + Send + 'storage,
A::Event: Send + Sync + 'storage,
R::Error: Send + 'storage,
P::Error: Send + 'storage,
impl<'storage, A, R, P> AsyncLifecycleContext<'storage, A, R, P>where
A: AggregateRoot + Send + 'storage,
R: AsyncRepository<Aggregate = A> + Send + 'storage,
P: AsyncDomainEventPublisher<Event = A::Event> + Send + 'storage,
A::Event: Send + Sync + 'storage,
R::Error: Send + 'storage,
P::Error: Send + 'storage,
Sourcepub fn new(
aggregate: &'storage mut A,
repository: &'storage mut R,
publisher: &'storage mut P,
) -> Self
pub fn new( aggregate: &'storage mut A, repository: &'storage mut R, publisher: &'storage mut P, ) -> Self
English: Creates a lifecycle context borrowing the aggregate, repository, and publisher mutably.
日本語: 集約、リポジトリ、パブリッシャーを可変借用するライフサイクルコンテキストを作成します。
Sourcepub fn save<'ctx>(
&'ctx mut self,
) -> Pin<Box<dyn Future<Output = Result<(), LifecycleOperationError<R::Error>>> + Send + 'ctx>>
pub fn save<'ctx>( &'ctx mut self, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleOperationError<R::Error>>> + Send + 'ctx>>
English: Attempts repository persistence once; adapter errors are returned and the attempt cannot be retried.
日本語: リポジトリへの保存を一度試行します。アダプターエラーを返し、再試行はできません。
Sourcepub fn dispatch<'ctx>(
&'ctx mut self,
) -> Pin<Box<dyn Future<Output = Result<(), LifecycleOperationError<P::Error>>> + Send + 'ctx>>
pub fn dispatch<'ctx>( &'ctx mut self, ) -> Pin<Box<dyn Future<Output = Result<(), LifecycleOperationError<P::Error>>> + Send + 'ctx>>
English: Attempts event dispatch once; adapter errors are returned and the attempt cannot be retried.
日本語: イベント配信を一度試行します。アダプターエラーを返し、再試行はできません。
Sourcepub fn complete(self) -> Result<(), LifecycleCompletionError>
pub fn complete(self) -> Result<(), LifecycleCompletionError>
English: Consumes the context and succeeds only when both save and dispatch succeeded.
日本語: コンテキストを消費し、保存と配信の両方が成功した場合にのみ成功します。