pub struct AggregateSnapshot<S> { /* private fields */ }Expand description
English: Exposes core 0.4’s domain, persistence, and event-workflow API.
日本語: コア 0.4 のドメイン、永続化、イベント処理 API を公開します。 English: Re-exports snapshot state containers, classification, storage contracts, and errors.
日本語: スナップショット状態コンテナー、分類、保存契約、エラーを再エクスポートします。
English: Owned aggregate state paired with the last event revision it represents.
No identifier or schema version is added; include validation metadata in S when needed.
日本語: 集約状態と、その状態が反映する最後のイベントのリビジョンを所有します。
識別子やスキーマバージョンは追加しません。検証用メタデータは必要に応じて S に含めます。
use ddd_toolkit_core::{AggregateSnapshot, StreamRevision};
let snapshot = AggregateSnapshot::new(42_u64, StreamRevision::new(3));
assert_eq!(*snapshot.state(), 42);
assert_eq!(snapshot.into_parts(), (42, StreamRevision::new(3)));Implementations§
Source§impl<S> AggregateSnapshot<S>
impl<S> AggregateSnapshot<S>
Sourcepub fn new(state: S, revision: StreamRevision) -> AggregateSnapshot<S>
pub fn new(state: S, revision: StreamRevision) -> AggregateSnapshot<S>
English: Pairs state with revision without checking consistency or compatibility.
日本語: 整合性や互換性を検証せず、state と revision を組み合わせます。
Sourcepub fn revision(&self) -> StreamRevision
pub fn revision(&self) -> StreamRevision
English: Returns the last event revision represented by the state.
日本語: 状態が反映する最後のイベントのリビジョンを返します。
Sourcepub fn into_parts(self) -> (S, StreamRevision)
pub fn into_parts(self) -> (S, StreamRevision)
English: Consumes the snapshot, returning state and revision without cloning.
日本語: スナップショットを消費し、複製せずに状態とリビジョンを返します。