pub struct InMemoryAuditSink { /* private fields */ }Expand description
In-memory audit sink for testing and development.
Stores all events in a Vec behind a RwLock. Supports querying and
purging. Not suitable for production — use FileAuditSink or a database
sink instead.
Implementations§
Trait Implementations§
Source§impl AuditSink for InMemoryAuditSink
impl AuditSink for InMemoryAuditSink
Source§fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log a single audit event.
Source§fn log_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<AuditEvent>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn log_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<AuditEvent>,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log a batch of audit events atomically. Read more
Source§fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 AuditFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
filter: &'life1 AuditFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query audit events matching the given filter. Read more
Auto Trait Implementations§
impl !Freeze for InMemoryAuditSink
impl !RefUnwindSafe for InMemoryAuditSink
impl Send for InMemoryAuditSink
impl Sync for InMemoryAuditSink
impl Unpin for InMemoryAuditSink
impl UnsafeUnpin for InMemoryAuditSink
impl UnwindSafe for InMemoryAuditSink
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