pub struct AuditContext { /* private fields */ }Expand description
The invocation-shared context for a sequence of audit records. One mutation
produces several records (attempt, then ok/error) that agree on actor, host,
operation, unit, and correlation id; capture those once here and stamp each
Outcome via AuditContext::record.
Implementations§
Source§impl AuditContext
impl AuditContext
Sourcepub fn new(
actor: &str,
target_host: &str,
operation: &str,
unit: &str,
correlation_id: &str,
) -> Self
pub fn new( actor: &str, target_host: &str, operation: &str, unit: &str, correlation_id: &str, ) -> Self
Capture the fields shared by every record for one mutation invocation.
Sourcepub fn record(&self, outcome: Outcome) -> AuditRecord
pub fn record(&self, outcome: Outcome) -> AuditRecord
Build a record for outcome, stamping the current Unix-millisecond time.
Trait Implementations§
Source§impl Clone for AuditContext
impl Clone for AuditContext
Source§fn clone(&self) -> AuditContext
fn clone(&self) -> AuditContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuditContext
impl RefUnwindSafe for AuditContext
impl Send for AuditContext
impl Sync for AuditContext
impl Unpin for AuditContext
impl UnsafeUnpin for AuditContext
impl UnwindSafe for AuditContext
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