pub struct AggregateSnapshot<S> { /* private fields */ }Expand description
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 に含めます。
§Example / 使用例
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.
日本語:
スナップショットを消費し、複製せずに状態とリビジョンを返します。
Trait Implementations§
Source§impl<S> Debug for AggregateSnapshot<S>where
S: Debug,
impl<S> Debug for AggregateSnapshot<S>where
S: Debug,
impl<S> Eq for AggregateSnapshot<S>where
S: Eq,
Source§impl<S> PartialEq for AggregateSnapshot<S>where
S: PartialEq,
impl<S> PartialEq for AggregateSnapshot<S>where
S: PartialEq,
impl<S> StructuralPartialEq for AggregateSnapshot<S>where
S: PartialEq,
Auto Trait Implementations§
impl<S> Freeze for AggregateSnapshot<S>where
S: Freeze,
impl<S> RefUnwindSafe for AggregateSnapshot<S>where
S: RefUnwindSafe,
impl<S> Send for AggregateSnapshot<S>where
S: Send,
impl<S> Sync for AggregateSnapshot<S>where
S: Sync,
impl<S> Unpin for AggregateSnapshot<S>where
S: Unpin,
impl<S> UnsafeUnpin for AggregateSnapshot<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for AggregateSnapshot<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more