Skip to main content

FileSnapshotStore

Struct FileSnapshotStore 

Source
pub struct FileSnapshotStore<P, C> { /* private fields */ }

Implementations§

Source§

impl<P, C> FileSnapshotStore<P, C>

Source

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.

Source

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>

Source§

fn save(&mut self, snapshot: &ProjectionSnapshot<P>) -> Result<()>

Saves an immutable projection snapshot. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.