pub struct FileSnapshotStore<P, C> { /* private fields */ }Implementations§
Source§impl<P, C> FileSnapshotStore<P, C>where
C: Codec<ProjectionSnapshot<P>>,
impl<P, C> FileSnapshotStore<P, C>where
C: Codec<ProjectionSnapshot<P>>,
Sourcepub fn open(
directory: impl AsRef<Path>,
prefix: impl Into<String>,
codec: C,
options: SnapshotOptions,
) -> Result<Self>
pub fn open( directory: impl AsRef<Path>, prefix: impl Into<String>, codec: C, options: SnapshotOptions, ) -> Result<Self>
Creates an immutable, generation-named snapshot store.
§Errors
Rejects an invalid prefix or inaccessible directory.
Sourcepub fn with_memory_mapped_reads(self) -> Self
pub fn with_memory_mapped_reads(self) -> Self
Enables guarded, read-only memory mapping for snapshot loads.
Generation files created by this store are immutable. Other processes must still honor advisory file locks and must never truncate a mapped generation.
Trait Implementations§
Source§impl<P, C> SnapshotStore<P> for FileSnapshotStore<P, C>where
C: Codec<ProjectionSnapshot<P>>,
impl<P, C> SnapshotStore<P> for FileSnapshotStore<P, C>where
C: Codec<ProjectionSnapshot<P>>,
Source§fn save(&mut self, snapshot: &ProjectionSnapshot<P>) -> Result<()>
fn save(&mut self, snapshot: &ProjectionSnapshot<P>) -> Result<()>
Saves an immutable projection snapshot. Read more
Source§fn load_latest(&self) -> Result<Option<ProjectionSnapshot<P>>>
fn load_latest(&self) -> Result<Option<ProjectionSnapshot<P>>>
Loads the snapshot with the greatest global event position. Read more
Auto Trait Implementations§
impl<P, C> Freeze for FileSnapshotStore<P, C>where
C: Freeze,
impl<P, C> RefUnwindSafe for FileSnapshotStore<P, C>where
C: RefUnwindSafe,
impl<P, C> Send for FileSnapshotStore<P, C>where
C: Send,
impl<P, C> Sync for FileSnapshotStore<P, C>where
C: Sync,
impl<P, C> Unpin for FileSnapshotStore<P, C>where
C: Unpin,
impl<P, C> UnsafeUnpin for FileSnapshotStore<P, C>where
C: UnsafeUnpin,
impl<P, C> UnwindSafe for FileSnapshotStore<P, C>where
C: 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