pub struct AuditLog { /* private fields */ }Expand description
Append-only audit log.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn append(&mut self, session_id: impl Into<SessionId>, event: AuditEvent)
pub fn append(&mut self, session_id: impl Into<SessionId>, event: AuditEvent)
Append an entry.
Sourcepub fn entries_for(&self, session_id: &str) -> Vec<&AuditEntry>
pub fn entries_for(&self, session_id: &str) -> Vec<&AuditEntry>
Get all entries for a session.
Sourcepub fn all(&self) -> &[AuditEntry]
pub fn all(&self) -> &[AuditEntry]
All entries.
Sourcepub fn export_json(&self) -> Result<String, Error>
pub fn export_json(&self) -> Result<String, Error>
Export as a JSON array.
Sourcepub fn query(&self, query: &AuditQuery) -> Vec<&AuditEntry>
pub fn query(&self, query: &AuditQuery) -> Vec<&AuditEntry>
Run a structured query against the audit log. Only non-None filters are applied — an empty query returns all entries.
Sourcepub fn query_by_signer(&self, signer_id: &str) -> Vec<&AuditEntry>
pub fn query_by_signer(&self, signer_id: &str) -> Vec<&AuditEntry>
All events involving a specific signer.
Sourcepub fn query_by_time_range(
&self,
start: DateTime<Utc>,
end: DateTime<Utc>,
) -> Vec<&AuditEntry>
pub fn query_by_time_range( &self, start: DateTime<Utc>, end: DateTime<Utc>, ) -> Vec<&AuditEntry>
All events within a time range (inclusive).
Trait Implementations§
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