pub struct AuditLog { /* private fields */ }Expand description
SQLite-backed audit log.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn open(vault_dir: &Path) -> Option<Self>
pub fn open(vault_dir: &Path) -> Option<Self>
Open (or create) the audit database at <vault_dir>/audit.db.
Returns None if the database can’t be opened — callers should
treat this as “audit logging unavailable” and continue normally.
Sourcepub fn log(
&self,
operation: &str,
environment: &str,
key_name: Option<&str>,
details: Option<&str>,
)
pub fn log( &self, operation: &str, environment: &str, key_name: Option<&str>, details: Option<&str>, )
Record an operation. Fire-and-forget — errors are silently ignored.
Sourcepub fn query(
&self,
limit: usize,
since: Option<DateTime<Utc>>,
) -> Result<Vec<AuditEntry>>
pub fn query( &self, limit: usize, since: Option<DateTime<Utc>>, ) -> Result<Vec<AuditEntry>>
Query recent audit entries.
limit: maximum number of entries to return (most recent first).since: if provided, only return entries newer than this timestamp.
Auto Trait Implementations§
impl !Freeze for AuditLog
impl !RefUnwindSafe for AuditLog
impl Send for AuditLog
impl !Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
impl !UnwindSafe for AuditLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more