1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! [`AuditSink`] — append-only emission of audit entries.
use ;
use async_trait;
/// Append-only sink for governance [`AuditEntry`] records.
///
/// Every governance decision produces one entry. The sink is write-only from the
/// runtime's perspective: it persists entries in order so the hash-chained audit
/// log stays verifiable. Backends may batch or buffer internally, but
/// [`emit`](AuditSink::emit) must not reorder entries relative to the calls.
///
/// # Example
///
/// ```
/// use aa_core::storage::{AuditEntry, AuditSink, Result};
/// use async_trait::async_trait;
///
/// /// A sink that discards every entry (useful as a test double).
/// struct NullAuditSink;
///
/// #[async_trait]
/// impl AuditSink for NullAuditSink {
/// async fn emit(&self, _event: AuditEntry) -> Result<()> {
/// Ok(())
/// }
/// }
/// ```