pub struct AuditLogEntry { /* private fields */ }Expand description
Single audit log entry for encryption operation
Implementations§
Source§impl AuditLogEntry
impl AuditLogEntry
Sourcepub fn new(
user_id: impl Into<String>,
field_name: impl Into<String>,
operation: OperationType,
request_id: impl Into<String>,
session_id: impl Into<String>,
) -> Self
pub fn new( user_id: impl Into<String>, field_name: impl Into<String>, operation: OperationType, request_id: impl Into<String>, session_id: impl Into<String>, ) -> Self
Create new audit log entry
Sourcepub fn with_failure(self, error: impl Into<String>) -> Self
pub fn with_failure(self, error: impl Into<String>) -> Self
Mark entry as failed
Sourcepub fn with_context(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_context( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add context data
Sourcepub fn with_security_context(
self,
ip_address: Option<&str>,
user_role: Option<&str>,
) -> Self
pub fn with_security_context( self, ip_address: Option<&str>, user_role: Option<&str>, ) -> Self
Add common security context data
Sourcepub fn field_name(&self) -> &str
pub fn field_name(&self) -> &str
Get field name
Sourcepub fn operation(&self) -> OperationType
pub fn operation(&self) -> OperationType
Get operation type
Sourcepub fn status(&self) -> EventStatus
pub fn status(&self) -> EventStatus
Get status
Sourcepub fn error_message(&self) -> Option<&str>
pub fn error_message(&self) -> Option<&str>
Get error message
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
Get request ID
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Get session ID
Sourcepub fn to_json_like(&self) -> String
pub fn to_json_like(&self) -> String
Convert to JSON-like string for logging
Trait Implementations§
Source§impl Clone for AuditLogEntry
impl Clone for AuditLogEntry
Source§fn clone(&self) -> AuditLogEntry
fn clone(&self) -> AuditLogEntry
Returns a duplicate of the value. Read more
1.0.0 · 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 AuditLogEntry
impl RefUnwindSafe for AuditLogEntry
impl Send for AuditLogEntry
impl Sync for AuditLogEntry
impl Unpin for AuditLogEntry
impl UnwindSafe for AuditLogEntry
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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