pub enum SnapshotPolicy {
Disabled,
EveryNEvents(i64),
}Expand description
Controls whether CommandBus maintains snapshots on the command/write
rehydrate path.
Disabled is the default and reproduces the original behavior exactly: every
dispatch replays the full event stream and no snapshot is ever read or
written. The event log stays the immutable source of truth in both modes —
a snapshot only short-circuits the rehydrate read, so enabling it can never
change correctness, only the cost of loading a long-lived aggregate.
Variants§
Disabled
No snapshot reads or writes; full from-zero replay on every dispatch.
EveryNEvents(i64)
Snapshot an aggregate once it has accumulated at least this many events since its last snapshot, and rehydrate from snapshot + event tail.
Trait Implementations§
Source§impl Clone for SnapshotPolicy
impl Clone for SnapshotPolicy
Source§fn clone(&self) -> SnapshotPolicy
fn clone(&self) -> SnapshotPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SnapshotPolicy
Source§impl Debug for SnapshotPolicy
impl Debug for SnapshotPolicy
Source§impl Default for SnapshotPolicy
impl Default for SnapshotPolicy
Source§fn default() -> SnapshotPolicy
fn default() -> SnapshotPolicy
Returns the “default value” for a type. Read more
impl Eq for SnapshotPolicy
Source§impl PartialEq for SnapshotPolicy
impl PartialEq for SnapshotPolicy
impl StructuralPartialEq for SnapshotPolicy
Auto Trait Implementations§
impl Freeze for SnapshotPolicy
impl RefUnwindSafe for SnapshotPolicy
impl Send for SnapshotPolicy
impl Sync for SnapshotPolicy
impl Unpin for SnapshotPolicy
impl UnsafeUnpin for SnapshotPolicy
impl UnwindSafe for SnapshotPolicy
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