pub struct InMemorySnapshotStore { /* private fields */ }Expand description
In-memory snapshot store backed by Arc<RwLock<HashMap>>.
Clone-friendly (cloning shares the same underlying storage).
Follows the same pattern as InMemoryReadModelStore.
Implementations§
Trait Implementations§
Source§impl Clone for InMemorySnapshotStore
impl Clone for InMemorySnapshotStore
Source§fn clone(&self) -> InMemorySnapshotStore
fn clone(&self) -> InMemorySnapshotStore
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 moreSource§impl Default for InMemorySnapshotStore
impl Default for InMemorySnapshotStore
Source§impl SnapshotStore for InMemorySnapshotStore
impl SnapshotStore for InMemorySnapshotStore
fn get_snapshot<'a>( &'a self, identity: &'a StreamIdentity, ) -> impl Future<Output = Result<Option<SnapshotRecord>, RepositoryError>> + Send + 'a
Source§fn get_snapshots<'a>(
&'a self,
identities: &'a [StreamIdentity],
) -> impl Future<Output = Result<Vec<SnapshotRecord>, RepositoryError>> + Send + 'a
fn get_snapshots<'a>( &'a self, identities: &'a [StreamIdentity], ) -> impl Future<Output = Result<Vec<SnapshotRecord>, RepositoryError>> + Send + 'a
Load the snapshots for the provided identities, skipping identities
without one. Each returned record carries its own aggregate type/id, so
callers can pair records back to identities. Read more
fn save_snapshot<'a>( &'a self, identity: &'a StreamIdentity, record: SnapshotRecord, ) -> impl Future<Output = Result<(), RepositoryError>> + Send + 'a
fn delete_snapshot<'a>( &'a self, identity: &'a StreamIdentity, ) -> impl Future<Output = Result<bool, RepositoryError>> + Send + 'a
Auto Trait Implementations§
impl Freeze for InMemorySnapshotStore
impl RefUnwindSafe for InMemorySnapshotStore
impl Send for InMemorySnapshotStore
impl Sync for InMemorySnapshotStore
impl Unpin for InMemorySnapshotStore
impl UnsafeUnpin for InMemorySnapshotStore
impl UnwindSafe for InMemorySnapshotStore
Blanket Implementations§
Source§impl<T> AggregateBuilder for T
impl<T> AggregateBuilder for T
fn aggregate<A: Aggregate>(self) -> AggregateRepository<Self, A>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Queueable for T
impl<T> Queueable for T
Source§fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
fn queued(self) -> QueuedRepository<Self, InMemoryLockManager>
Wrap with the default async lock manager. Pair with
.aggregate::<T>() for per-aggregate serialization over the async
repository surface.Source§fn queued_with<L: LockManager>(
self,
lock_manager: L,
) -> QueuedRepository<Self, L>
fn queued_with<L: LockManager>( self, lock_manager: L, ) -> QueuedRepository<Self, L>
Wrap with a custom async lock manager.