pub struct AuditLog { /* private fields */ }Expand description
The server’s audit trail: builds events and fans them out to sinks. Cheap to clone.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn new(kafka: Option<KafkaSink>) -> Self
pub fn new(kafka: Option<KafkaSink>) -> Self
The production trail: the log copy plus kafka, when configured.
Sourcepub fn with_sinks(sinks: Vec<Arc<dyn AuditSink>>) -> Self
pub fn with_sinks(sinks: Vec<Arc<dyn AuditSink>>) -> Self
A trail with exactly these sinks (tests plug a capturing sink).
Sourcepub fn event(&self, kind: EventKind, action: String) -> AuditEvent
pub fn event(&self, kind: EventKind, action: String) -> AuditEvent
A fresh event of kind with its id, timestamp and emitter
filled in; the caller sets the rest.
Sourcepub fn emit(&self, event: AuditEvent)
pub fn emit(&self, event: AuditEvent)
Fill in event.summary and hand the event to every sink. Never
blocks, never fails.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuditLog
impl !UnwindSafe for AuditLog
impl Freeze for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreCreates a shared type from an unshared type.