AuditStorage

Trait AuditStorage 

Source
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§

Source

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

Source

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

Source

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

Source

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

Source

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)

Source

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

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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,

Source§

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§

Source§

impl AuditStorage for MemoryStorage

Implementation of AuditStorage for MemoryStorage