pub struct MemoryLogger { /* private fields */ }Expand description
A logger that collects events in memory for testing.
Implementations§
Trait Implementations§
Source§impl AuditLogger for MemoryLogger
impl AuditLogger for MemoryLogger
Source§fn log<'life0, 'async_trait>(
&'life0 self,
event: AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + 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<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log an audit event.
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Flush any buffered events.
Source§fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuditStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuditStats> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get statistics about logged events.
Source§fn log_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<AuditEvent>,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + 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<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Log multiple events in a batch.
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuditError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the logger is healthy.
Source§impl Default for MemoryLogger
impl Default for MemoryLogger
Source§fn default() -> MemoryLogger
fn default() -> MemoryLogger
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryLogger
impl !RefUnwindSafe for MemoryLogger
impl Send for MemoryLogger
impl Sync for MemoryLogger
impl Unpin for MemoryLogger
impl UnsafeUnpin for MemoryLogger
impl UnwindSafe for MemoryLogger
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