Skip to main content

AuditStore

Trait AuditStore 

Source
pub trait AuditStore: Send + Sync {
    // Required method
    fn insert_batch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        records: &'life1 [AuditRecord],
        ingested_at: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AuditRow>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Append-only persistence for audit records.

Only one mutation method — insert_batch. A batch is rejected wholesale if any record fails AuditRecord::validate; no partial commits, so kamaji’s retry-with-backoff sees a clean 4xx.

Read APIs (paged by on_behalf_of + filters) land alongside F14.

Required Methods§

Source

fn insert_batch<'life0, 'life1, 'async_trait>( &'life0 self, records: &'life1 [AuditRecord], ingested_at: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuditRow>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Insert a batch of records atomically. The impl assigns each row a fresh opaque id and stamps ingested_at. Returns the resulting AuditRows in the same order as the input.

Validation is the caller’s responsibility — pass already-validated AuditRecords (the HTTP layer runs AuditRecord::validate over the batch before calling here). The trait does not re-validate; it just durably appends.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§