pub struct TrailAuditSink { /* private fields */ }Expand description
Production audit sink: Merkle chain + async JSONL file writer.
Events are:
- Appended to the
AuditTrail(Merkle chain, tamper-evident) - Sent to a background file writer via bounded channel (JSONL)
If the channel is full, a warning is logged and the event is still recorded in the Merkle chain (just not persisted to file immediately).
Implementations§
Source§impl TrailAuditSink
impl TrailAuditSink
Sourcepub fn new(trail: Arc<AuditTrail>, audit_path: PathBuf) -> Self
pub fn new(trail: Arc<AuditTrail>, audit_path: PathBuf) -> Self
Create a new TrailAuditSink.
Spawns a background tokio task that reads from the bounded channel
and appends JSONL entries to audit_path.
Trait Implementations§
Source§impl AuditSink for TrailAuditSink
impl AuditSink for TrailAuditSink
Source§fn record(&self, event: AuditEvent)
fn record(&self, event: AuditEvent)
Record a security audit event.
Auto Trait Implementations§
impl !RefUnwindSafe for TrailAuditSink
impl !UnwindSafe for TrailAuditSink
impl Freeze for TrailAuditSink
impl Send for TrailAuditSink
impl Sync for TrailAuditSink
impl Unpin for TrailAuditSink
impl UnsafeUnpin for TrailAuditSink
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