pub trait AuditStorage: Send + Sync {
// Required methods
fn store_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn query_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuditEvent>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn count_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_old_events<'life0, 'async_trait>(
&'life0 self,
before: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StatsQuery,
) -> Pin<Box<dyn Future<Output = Result<AuditStatistics>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Audit log storage trait
Required Methods§
Sourcefn store_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store an audit event
Sourcefn query_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query audit events with filters
Sourcefn get_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get event by ID
Sourcefn count_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count events matching criteria
Sourcefn delete_old_events<'life0, 'async_trait>(
&'life0 self,
before: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_old_events<'life0, 'async_trait>(
&'life0 self,
before: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete old events (for retention management)
Sourcefn get_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StatsQuery,
) -> Pin<Box<dyn Future<Output = Result<AuditStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StatsQuery,
) -> Pin<Box<dyn Future<Output = Result<AuditStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get audit statistics
Implementations on Foreign Types§
Source§impl AuditStorage for Arc<MemoryStorage>
Implementation of AuditStorage for Arc
impl AuditStorage for Arc<MemoryStorage>
Implementation of AuditStorage for Arc
fn store_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 AuditEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_event<'life0, 'life1, 'async_trait>(
&'life0 self,
event_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<AuditEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_events<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 AuditQuery,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_old_events<'life0, 'async_trait>(
&'life0 self,
before: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_statistics<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 StatsQuery,
) -> Pin<Box<dyn Future<Output = Result<AuditStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Implementors§
impl AuditStorage for MemoryStorage
Implementation of AuditStorage for MemoryStorage