Skip to main content

LogPersistence

Trait LogPersistence 

Source
pub trait LogPersistence<R>: Send + Sync {
    // Required methods
    fn load(
        &self,
        expected_object: ObjectIdentifier,
    ) -> Result<Option<LogSnapshot<R>>, Error>;
    fn commit(&self, snapshot: &LogSnapshot<R>) -> Result<(), Error>;
}
Expand description

Application-owned storage for one log’s LogSnapshot.

The log calls load once, as it opens, and commit from its writer thread, one call at a time.

Required Methods§

Source

fn load( &self, expected_object: ObjectIdentifier, ) -> Result<Option<LogSnapshot<R>>, Error>

Load the newest valid snapshot for expected_object, or None when storage holds none yet.

Source

fn commit(&self, snapshot: &LogSnapshot<R>) -> Result<(), Error>

Durably store snapshot, whose generation is one past the last one committed (or loaded).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§