Skip to main content

AuditLog

Struct AuditLog 

Source
pub struct AuditLog { /* private fields */ }
Expand description

SQLite-backed audit log.

Implementations§

Source§

impl AuditLog

Source

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.

Source

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.

Source

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.
Source

pub fn purge(&self, before: DateTime<Utc>) -> Result<usize>

Delete audit entries older than the given timestamp. Returns the number of entries deleted.

Source

pub fn db_path(vault_dir: &Path) -> PathBuf

Return the path to the audit database (for testing/display).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V