pub struct Snapshot<Pos, Data> {
pub position: Pos,
pub data: Data,
}Expand description
Point-in-time snapshot of aggregate state.
The position field indicates the event stream position when this snapshot
was taken. When loading an aggregate, only events after this position need
to be replayed.
Schema evolution is handled at the serialisation layer (e.g., via
serde_evolve), so no version field is needed here.
§Type Parameters
Pos: The position type used by the event store (e.g.,u64,i64, etc.)Data: The snapshot payload type.
Fields§
§position: PosEvent position when this snapshot was taken.
data: DataSnapshot payload.
Trait Implementations§
Auto Trait Implementations§
impl<Pos, Data> Freeze for Snapshot<Pos, Data>
impl<Pos, Data> RefUnwindSafe for Snapshot<Pos, Data>where
Pos: RefUnwindSafe,
Data: RefUnwindSafe,
impl<Pos, Data> Send for Snapshot<Pos, Data>
impl<Pos, Data> Sync for Snapshot<Pos, Data>
impl<Pos, Data> Unpin for Snapshot<Pos, Data>
impl<Pos, Data> UnwindSafe for Snapshot<Pos, Data>where
Pos: UnwindSafe,
Data: 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