pub struct AuditPipeline { /* private fields */ }Expand description
Lock-free front door for audit records.
Not #[Injectable] — provide via ctx.provide(AuditPipeline::new(...)).
When absent from the DI container, #[AuditLog] routes are a no-op.
Implementations§
Source§impl AuditPipeline
impl AuditPipeline
Sourcepub fn new(
sink: Arc<dyn AuditSink>,
capacity: usize,
flush_batch: usize,
) -> Self
pub fn new( sink: Arc<dyn AuditSink>, capacity: usize, flush_batch: usize, ) -> Self
capacity bounds hot-path memory; flush_batch caps records per sink
write. The worker drains greedily, so latency under light load is one
scheduler tick, not a timer.
Sourcepub fn record(&self, rec: AuditRecord)
pub fn record(&self, rec: AuditRecord)
O(1), lock-free, never blocks. Drops (and counts) when the buffer is full rather than stalling request handling.
Auto Trait Implementations§
impl Freeze for AuditPipeline
impl RefUnwindSafe for AuditPipeline
impl Send for AuditPipeline
impl Sync for AuditPipeline
impl Unpin for AuditPipeline
impl UnsafeUnpin for AuditPipeline
impl UnwindSafe for AuditPipeline
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request