arsenal-broker · audit_sink
Declared module signatures, types, configuration, and source documentation.
Source: arsenal/crates/arsenal-broker/src/audit_sink.rs. SHA-256: eadf9c8a5735b18817d1a2389c227dd0ae30fc7a73e5869a3039aedb3b1c3e75.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
audit_sink::AuditSinkResult
Result type for audit sink operations
pub type AuditSinkResult<T> = Result<T, AuditSinkError>;Source line: 19.
audit_sink::AuditSinkError
Errors from audit sinks
#[derive(Debug, thiserror::Error)]
pub enum AuditSinkError {
/// I/O error
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
/// Serialization error
#[error("Serialization error: {0}")]
SerializationError(String),
/// Connection error
#[error("Connection error: {0}")]
ConnectionError(String),
/// Sink is closed
#[error("Sink is closed")]
Closed,
/// Buffer overflow
#[error("Buffer overflow")]
BufferOverflow,
}Source line: 23.
audit_sink::AuditSink
Trait for audit event sinks (object-safe version)
pub trait AuditSink: Send + Sync {
/// Emit an audit event
fn emit(&self, event: AuditEvent) -> BoxFuture<'_, AuditSinkResult<()>>;
/// Flush any buffered events
fn flush(&self) -> BoxFuture<'_, AuditSinkResult<()>>;
/// Close the sink
fn close(&self) -> BoxFuture<'_, AuditSinkResult<()>>;
}Source line: 49.
audit_sink::NoOpAuditSink
No-op audit sink (for testing or when auditing is disabled)
pub struct NoOpAuditSink;Source line: 61.
audit_sink::TracingAuditSink
Tracing-based audit sink (logs to tracing framework)
pub struct TracingAuditSink {
}Source line: 78.
audit_sink::TracingAuditSink::new
Create a new tracing audit sink
Returns
A new tracing audit sink
#[must_use]
pub fn new() -> Self;Source line: 88.
audit_sink::TracingAuditSink::with_full_event
Enable full event logging
#[must_use]
pub fn with_full_event(mut self) -> Self;Source line: 96.
audit_sink::FileAuditSink
File-based audit sink with append-only logging
pub struct FileAuditSink {
}Source line: 148.
audit_sink::FileAuditSink::new
Create a new file audit sink
Parameters
path- The path to the audit log file
Errors
Returns an error if the log file cannot be created or opened.
Returns
A new file audit sink
pub fn new(path: impl AsRef<Path>) -> Result<Self, AuditSinkError>;Source line: 169.
audit_sink::FileAuditSink::with_buffer_size
Set the buffer size for the file audit sink
Parameters
size- The buffer size
Returns
A new file audit sink
#[must_use]
pub fn with_buffer_size(mut self, size: usize) -> Self;Source line: 198.
audit_sink::FileAuditSink::without_hash_chain
Disable hash chain for the file audit sink
Returns
A new file audit sink
#[must_use]
pub fn without_hash_chain(mut self) -> Self;Source line: 208.
audit_sink::FileAuditSink::rotate
Rotate the audit log file
Errors
Returns an error if the file cannot be flushed, renamed, or recreated.
Returns
The path to the rotated audit log file
pub async fn rotate(&self) -> Result<PathBuf, AuditSinkError>;Source line: 221.
audit_sink::CompositeAuditSink
Composite audit sink that writes to multiple sinks
pub struct CompositeAuditSink {
}Source line: 316.
audit_sink::CompositeAuditSink::new
Create a new composite audit sink
Returns
A new composite audit sink
#[must_use]
pub fn new() -> Self;Source line: 327.
audit_sink::CompositeAuditSink::with_sink
Add a sink to the composite audit sink
Parameters
sink- The sink to add
Returns
A new composite audit sink
#[must_use]
pub fn with_sink(mut self, sink: Arc<dyn AuditSink>) -> Self;Source line: 342.
audit_sink::CompositeAuditSink::fail_fast
Set the fail fast flag for the composite audit sink
Returns
A new composite audit sink
#[must_use]
pub fn fail_fast(mut self) -> Self;Source line: 352.
audit_sink::AsyncBufferedSink
Async buffered sink with background flushing
pub struct AsyncBufferedSink {
}Source line: 413.
audit_sink::AsyncBufferedSink::new
Create a new async buffered audit sink
Parameters
inner- The inner audit sinkbuffer_size- The buffer size
Returns
A new async buffered audit sink
pub fn new(inner: Arc<dyn AuditSink>, buffer_size: usize) -> Self;Source line: 428.