pub struct AuditTrace { /* private fields */ }Expand description
Fixed-capacity audit trace buffer (stack-allocated, no_alloc compatible).
Stores the most recent N audit events in a ring buffer. When the
buffer is full, the oldest events are overwritten. For full-history
audit, use the std feature to write events to a file or stream.
Implementations§
Source§impl AuditTrace
impl AuditTrace
Sourcepub fn record(&mut self, event: AuditEvent)
pub fn record(&mut self, event: AuditEvent)
Record an audit event.
Sourcepub fn total_count(&self) -> u64
pub fn total_count(&self) -> u64
Total number of events recorded (may exceed buffer capacity).
Sourcepub fn buffered_count(&self) -> usize
pub fn buffered_count(&self) -> usize
Number of events currently in the buffer (max 256).
Sourcepub fn last(&self) -> Option<&AuditEvent>
pub fn last(&self) -> Option<&AuditEvent>
Get the most recent audit event, if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuditTrace
impl RefUnwindSafe for AuditTrace
impl Send for AuditTrace
impl Sync for AuditTrace
impl Unpin for AuditTrace
impl UnsafeUnpin for AuditTrace
impl UnwindSafe for AuditTrace
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