Skip to main content

AuditLogPersistence

Trait AuditLogPersistence 

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

Application-owned persistence port for one AuditLog object.

The object calls it from its writer thread, one call at a time. A commit lands in storage a moment before the log serves it: see storage leads the served state.

Required Methods§

Source

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

Load the newest valid compatible snapshot, or None if neither slot exists.

Source

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

Durably replace one slot with a complete prospective snapshot.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§