Skip to main content

AuditSink

Trait AuditSink 

Source
pub trait AuditSink: Send + Sync {
    // Required method
    fn emit(&self, event: &AuditEvent);

    // Provided method
    fn flush(&self, _timeout: Duration) { ... }
}
Expand description

A destination for audit events.

emit is called on the request path and must not block: queue the event and return. Failures are the sink’s to log; they never reach the request.

Required Methods§

Source

fn emit(&self, event: &AuditEvent)

Hand one event to the destination.

Provided Methods§

Source

fn flush(&self, _timeout: Duration)

Drain anything still queued, waiting at most timeout. Called once at shutdown, off the async runtime (it may block).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§