pub struct FileLogPersistence { /* private fields */ }Expand description
Two-slot, versioned and checksummed file store for one log’s snapshots,
as FileAuditLogPersistence
keeps an Audit Log’s.
Commits alternate between base.slot0 and base.slot1 by generation,
and each one fully writes and synchronizes its slot, so a commit cut off
part way leaves the other slot’s snapshot to load. The first commit to a
slot also synchronizes its directory (on Unix; see
durable).
Loading takes the newer valid slot. A slot that is damaged (truncated, a bad checksum, or contents that don’t decode or don’t hold together) is passed over for the other one, with a warning; loading fails when both are damaged. It also fails, without falling back, when a slot belongs to another object or uses a schema this build can’t read, when reading either slot fails, and when both slots hold different snapshots of one generation. It does not coordinate several processes.
Implementations§
Trait Implementations§
Source§impl Clone for FileLogPersistence
impl Clone for FileLogPersistence
Source§impl Debug for FileLogPersistence
impl Debug for FileLogPersistence
Source§impl LogPersistence<BACnetEventLogRecord> for FileLogPersistence
impl LogPersistence<BACnetEventLogRecord> for FileLogPersistence
Source§fn load(
&self,
expected_object: ObjectIdentifier,
) -> Result<Option<LogSnapshot<BACnetEventLogRecord>>, Error>
fn load( &self, expected_object: ObjectIdentifier, ) -> Result<Option<LogSnapshot<BACnetEventLogRecord>>, Error>
expected_object, or None when
storage holds none yet.Source§fn commit(
&self,
snapshot: &LogSnapshot<BACnetEventLogRecord>,
) -> Result<(), Error>
fn commit( &self, snapshot: &LogSnapshot<BACnetEventLogRecord>, ) -> Result<(), Error>
snapshot, whose generation is one past the last one
committed (or loaded).Source§impl LogPersistence<BACnetLogMultipleRecord> for FileLogPersistence
impl LogPersistence<BACnetLogMultipleRecord> for FileLogPersistence
Source§fn load(
&self,
expected_object: ObjectIdentifier,
) -> Result<Option<LogSnapshot<BACnetLogMultipleRecord>>, Error>
fn load( &self, expected_object: ObjectIdentifier, ) -> Result<Option<LogSnapshot<BACnetLogMultipleRecord>>, Error>
expected_object, or None when
storage holds none yet.Source§fn commit(
&self,
snapshot: &LogSnapshot<BACnetLogMultipleRecord>,
) -> Result<(), Error>
fn commit( &self, snapshot: &LogSnapshot<BACnetLogMultipleRecord>, ) -> Result<(), Error>
snapshot, whose generation is one past the last one
committed (or loaded).Source§impl LogPersistence<BACnetLogRecord> for FileLogPersistence
impl LogPersistence<BACnetLogRecord> for FileLogPersistence
Source§fn load(
&self,
expected_object: ObjectIdentifier,
) -> Result<Option<LogSnapshot<BACnetLogRecord>>, Error>
fn load( &self, expected_object: ObjectIdentifier, ) -> Result<Option<LogSnapshot<BACnetLogRecord>>, Error>
expected_object, or None when
storage holds none yet.Source§fn commit(&self, snapshot: &LogSnapshot<BACnetLogRecord>) -> Result<(), Error>
fn commit(&self, snapshot: &LogSnapshot<BACnetLogRecord>) -> Result<(), Error>
snapshot, whose generation is one past the last one
committed (or loaded).