pub struct AuditEntry {
pub id: String,
pub timestamp: SystemTime,
pub event_type: AuditEventType,
pub severity: AuditSeverity,
pub outcome: AuditOutcome,
pub resource: Option<String>,
pub action: String,
pub details: Option<String>,
pub metadata: AuditMetadata,
pub duration_ms: Option<u64>,
}Expand description
Audit log entry
Fields§
§id: StringUnique entry ID
timestamp: SystemTimeTimestamp
event_type: AuditEventTypeEvent type
severity: AuditSeveritySeverity level
outcome: AuditOutcomeOutcome
resource: Option<String>Resource affected (e.g., vector ID, index name)
action: StringAction description
details: Option<String>Additional details
metadata: AuditMetadataMetadata (user, IP, etc.)
duration_ms: Option<u64>Duration in milliseconds (for operations)
Implementations§
Source§impl AuditEntry
impl AuditEntry
Sourcepub fn new(event_type: AuditEventType, action: impl Into<String>) -> Self
pub fn new(event_type: AuditEventType, action: impl Into<String>) -> Self
Create a new audit entry
Sourcepub fn with_severity(self, severity: AuditSeverity) -> Self
pub fn with_severity(self, severity: AuditSeverity) -> Self
Set severity
Sourcepub fn with_outcome(self, outcome: AuditOutcome) -> Self
pub fn with_outcome(self, outcome: AuditOutcome) -> Self
Set outcome
Sourcepub fn with_resource(self, resource: impl Into<String>) -> Self
pub fn with_resource(self, resource: impl Into<String>) -> Self
Set resource
Sourcepub fn with_details(self, details: impl Into<String>) -> Self
pub fn with_details(self, details: impl Into<String>) -> Self
Set details
Sourcepub fn with_duration(self, duration_ms: u64) -> Self
pub fn with_duration(self, duration_ms: u64) -> Self
Set duration
Trait Implementations§
Source§impl Clone for AuditEntry
impl Clone for AuditEntry
Source§fn clone(&self) -> AuditEntry
fn clone(&self) -> AuditEntry
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 moreSource§impl Debug for AuditEntry
impl Debug for AuditEntry
Source§impl<'de> Deserialize<'de> for AuditEntry
impl<'de> Deserialize<'de> for AuditEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuditEntry
impl RefUnwindSafe for AuditEntry
impl Send for AuditEntry
impl Sync for AuditEntry
impl Unpin for AuditEntry
impl UnsafeUnpin for AuditEntry
impl UnwindSafe for AuditEntry
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more