Skip to main content

AuditLogBackend

Trait AuditLogBackend 

Source
pub trait AuditLogBackend: Send + Sync {
    // Required method
    fn record<'a>(
        &'a self,
        entry: &'a AuditEntry,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand description

Object-safe backend trait for audit log storage.

Implement this trait to use a custom storage backend (e.g., remote logging service, file-based). The built-in SQLite backend is used by AuditLog::new().

Required Methods§

Source

fn record<'a>( &'a self, entry: &'a AuditEntry, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Persist an audit entry.

§Errors

Returns an error if the backend fails to persist the entry.

Implementors§