pub struct InMemoryAuditSink { /* private fields */ }Expand description
Bounded in-memory ring-buffer AuditSink suitable for testing and recent audit queries.
Implementations§
Source§impl InMemoryAuditSink
Bounded ring-buffer operations for InMemoryAuditSink.
impl InMemoryAuditSink
Bounded ring-buffer operations for InMemoryAuditSink.
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Creates a new InMemoryAuditSink retaining at most capacity records (>= 1).
§Arguments
usize- Maximum number of records retained in memory.
§Returns
Self- Bounded in-memory audit sink.
Sourcepub fn snapshot(&self) -> Vec<AuditRecord>
pub fn snapshot(&self) -> Vec<AuditRecord>
Returns a cloned snapshot of all currently buffered records in chronological order.
§Returns
Vec<AuditRecord>- Buffered audit records.
Trait Implementations§
Source§impl AuditSink for InMemoryAuditSink
Implements AuditSink for InMemoryAuditSink.
impl AuditSink for InMemoryAuditSink
Implements AuditSink for InMemoryAuditSink.
Source§fn record(&self, event: AuditRecord)
fn record(&self, event: AuditRecord)
Appends event to the bounded ring buffer, evicting the oldest record if full.
§Arguments
AuditRecord- Finalized audit event.
Auto Trait Implementations§
impl !Freeze for InMemoryAuditSink
impl Forget for InMemoryAuditSink
impl Move for InMemoryAuditSink
impl RefUnwindSafe for InMemoryAuditSink
impl Send for InMemoryAuditSink
impl Sync for InMemoryAuditSink
impl Unpin for InMemoryAuditSink
impl UnsafeUnpin for InMemoryAuditSinkwhere
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<AuditRecord>: UnsafeUnpin,
impl UnwindSafe for InMemoryAuditSink
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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