Skip to main content

AuditSink

Trait AuditSink 

Source
pub trait AuditSink:
    Send
    + Sync
    + Debug {
    // Required method
    fn emit(&self, record: &AuditRecord);
}
Expand description

Pluggable target for AuditRecord emission.

Implementations must be Send + Sync because the audit middleware shares a single instance across all in-flight requests through an Arc<dyn AuditSink>.

Required Methods§

Source

fn emit(&self, record: &AuditRecord)

Persist record. Errors are intentionally absorbed: an audit failure must never bubble up and corrupt a successful API call. Implementations should log internally via tracing::error! instead of propagating.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§