pub struct Store<Id, Pos> { /* private fields */ }Implementations§
Source§impl<Id, Pos> Store<Id, Pos>
impl<Id, Pos> Store<Id, Pos>
Sourcepub fn always() -> Self
pub fn always() -> Self
Create a snapshot store that saves after every command.
Best for aggregates with expensive replay or many events. See the policy guidelines above for choosing an appropriate cadence.
Trait Implementations§
Source§impl<Id, Pos> SnapshotStore<Id> for Store<Id, Pos>
impl<Id, Pos> SnapshotStore<Id> for Store<Id, Pos>
Source§async fn load<T>(
&self,
kind: &str,
id: &Id,
) -> Result<Option<Snapshot<Pos, T>>, Self::Error>where
T: DeserializeOwned,
async fn load<T>(
&self,
kind: &str,
id: &Id,
) -> Result<Option<Snapshot<Pos, T>>, Self::Error>where
T: DeserializeOwned,
Load the most recent snapshot for an aggregate. Read more
Source§async fn offer_snapshot<CE, T, Create>(
&self,
kind: &str,
id: &Id,
events_since_last_snapshot: u64,
create_snapshot: Create,
) -> Result<SnapshotOffer, OfferSnapshotError<Self::Error, CE>>
async fn offer_snapshot<CE, T, Create>( &self, kind: &str, id: &Id, events_since_last_snapshot: u64, create_snapshot: Create, ) -> Result<SnapshotOffer, OfferSnapshotError<Self::Error, CE>>
Whether to store a snapshot, with lazy snapshot creation. Read more
Auto Trait Implementations§
impl<Id, Pos> Freeze for Store<Id, Pos>
impl<Id, Pos> RefUnwindSafe for Store<Id, Pos>
impl<Id, Pos> Send for Store<Id, Pos>
impl<Id, Pos> Sync for Store<Id, Pos>
impl<Id, Pos> Unpin for Store<Id, Pos>
impl<Id, Pos> UnwindSafe for Store<Id, Pos>
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