pub struct AuditLog { /* private fields */ }Expand description
Bounded process-local audit log.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn with_max_bytes(max_bytes: usize) -> Self
pub fn with_max_bytes(max_bytes: usize) -> Self
Creates an empty audit log with an aggregate retained-byte budget.
Sourcepub fn attach_journal(&self, journal: Arc<FileOperationalJournal>)
pub fn attach_journal(&self, journal: Arc<FileOperationalJournal>)
Attaches a journal, sharing safe entries and sanitizing any unsafe record.
Sourcepub fn durability_error(&self) -> Option<String>
pub fn durability_error(&self) -> Option<String>
Returns the last durable journal failure, when persistence degraded.
Sourcepub fn push(&self, record: AuditRecord)
pub fn push(&self, record: AuditRecord)
Appends a command record and its generic audit projection.
Sourcepub fn push_entry(&self, entry: AuditEntry)
pub fn push_entry(&self, entry: AuditEntry)
Appends one generic audit entry after redaction.
Sourcepub fn records(&self) -> Vec<AuditRecord>
pub fn records(&self) -> Vec<AuditRecord>
Returns a point-in-time copy of command records.
Sourcepub fn entries(&self) -> Vec<AuditEntry>
pub fn entries(&self) -> Vec<AuditEntry>
Returns a point-in-time copy of generic audit entries.
Sourcepub fn records_snapshot(&self) -> AuditRecordsSnapshot
pub fn records_snapshot(&self) -> AuditRecordsSnapshot
Returns a shared immutable snapshot without cloning record fields.
Sourcepub fn entries_snapshot(&self) -> AuditEntriesSnapshot
pub fn entries_snapshot(&self) -> AuditEntriesSnapshot
Returns a shared immutable snapshot without cloning entry fields.
Sourcepub fn stats(&self) -> AuditLogStats
pub fn stats(&self) -> AuditLogStats
Returns current count, byte-pressure, eviction, and rejection metrics.
Sourcepub fn write_jsonl(&self, writer: &mut impl Write) -> Result<()>
pub fn write_jsonl(&self, writer: &mut impl Write) -> Result<()>
Writes generic entries as JSONL from a shared immutable snapshot.
Sourcepub fn export_jsonl(&self) -> Result<String, Error>
pub fn export_jsonl(&self) -> Result<String, Error>
Exports generic entries as newline-delimited JSON.