pub struct AuditLogger { /* private fields */ }Implementations§
Source§impl AuditLogger
impl AuditLogger
Sourcepub fn for_data_path(data_path: &Path) -> Self
pub fn for_data_path(data_path: &Path) -> Self
Place the audit log next to the primary .rdb file so backup
- restore flows can ship it together.
Sourcepub fn with_path(path: PathBuf) -> Self
pub fn with_path(path: PathBuf) -> Self
Direct constructor primarily for tests that want a custom path.
Sourcepub fn with_max_bytes(path: PathBuf, max_bytes: u64) -> Self
pub fn with_max_bytes(path: PathBuf, max_bytes: u64) -> Self
Test/integration constructor with explicit settings — bypasses
env-var resolution so parallel tests don’t race on set_var.
pub fn path(&self) -> &Path
Sourcepub fn current_hash(&self) -> Option<String>
pub fn current_hash(&self) -> Option<String>
Latest tip-hash of the chain (for diagnostics + tests).
Sourcepub fn wait_idle(&self, timeout: Duration) -> bool
pub fn wait_idle(&self, timeout: Duration) -> bool
Block until the writer thread has drained every pending event. Tests use this to make assertions deterministic.
Sourcepub fn record(
&self,
action: &str,
principal: &str,
target: &str,
result: &str,
details: JsonValue,
)
pub fn record( &self, action: &str, principal: &str, target: &str, result: &str, details: JsonValue, )
Back-compat record signature. Used by every existing emit site.
Wraps into the new schema and forwards to record_event.
Sourcepub fn record_event(&self, event: AuditEvent)
pub fn record_event(&self, event: AuditEvent)
Primary new entry point. Non-blocking when the channel has capacity; falls back to a sync write when full or the writer thread has shut down.
Trait Implementations§
Source§impl Debug for AuditLogger
impl Debug for AuditLogger
Source§impl Drop for AuditLogger
impl Drop for AuditLogger
Auto Trait Implementations§
impl !Freeze for AuditLogger
impl RefUnwindSafe for AuditLogger
impl Send for AuditLogger
impl Sync for AuditLogger
impl Unpin for AuditLogger
impl UnsafeUnpin for AuditLogger
impl UnwindSafe for AuditLogger
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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