pub struct NoAudit;Expand description
AuditSink implementation that discards every event.
This is the vault’s default; constructing a KeyVault without
calling KeyVaultBuilder::with_audit_sink
leaves the audit trail unrouted. Events are still constructed by the
vault and passed through this sink — the cost is one struct
construction + one virtual call per operation, both negligible.
Use this explicitly when you want to make “no audit configured” a load-bearing part of your vault setup.
§Examples
use key_vault::{KeyVaultBuilder, NoAudit};
let _vault = KeyVaultBuilder::new()
.with_audit_sink(NoAudit)
.build();Trait Implementations§
Source§impl AuditSink for NoAudit
impl AuditSink for NoAudit
Source§fn on_event(&self, _event: &AuditEvent)
fn on_event(&self, _event: &AuditEvent)
Receive one audit event. The sink may inspect any field but
must not mutate the event (it is passed by reference).
Source§fn is_no_op(&self) -> bool
fn is_no_op(&self) -> bool
Hot-path optimization hook: a sink that returns
true here
declares that it will discard every event without inspecting
any field. The vault uses this to skip AuditEvent
construction entirely on the hot path, avoiding one String
allocation per with_key / fragment / defragment call. Read moreimpl Copy for NoAudit
Auto Trait Implementations§
impl Freeze for NoAudit
impl RefUnwindSafe for NoAudit
impl Send for NoAudit
impl Sync for NoAudit
impl Unpin for NoAudit
impl UnsafeUnpin for NoAudit
impl UnwindSafe for NoAudit
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