pub struct AuditEvent {Show 13 fields
pub id: String,
pub timestamp: String,
pub suppression_id: String,
pub action: AuditAction,
pub severity: AuditSeverity,
pub actor: String,
pub actor_email: Option<String>,
pub description: Option<String>,
pub reason: Option<String>,
pub changes: Vec<FieldChange>,
pub context: AuditContext,
pub related_events: Vec<String>,
pub tags: Vec<String>,
}Expand description
An enhanced audit event with full context
Fields§
§id: StringUnique event ID
timestamp: StringWhen this event occurred (ISO 8601)
suppression_id: StringID of the suppression this event relates to
action: AuditActionWhat action was taken
severity: AuditSeveritySeverity of this event
actor: StringWho performed the action
actor_email: Option<String>Actor’s email (if available)
description: Option<String>Human-readable description
reason: Option<String>Detailed reason for the action
changes: Vec<FieldChange>Fields that changed
context: AuditContextEnvironment context
Related event IDs (for linked actions)
Tags for categorization
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(
suppression_id: impl Into<String>,
action: AuditAction,
actor: impl Into<String>,
) -> Self
pub fn new( suppression_id: impl Into<String>, action: AuditAction, actor: impl Into<String>, ) -> Self
Create a new audit event with auto-generated ID and timestamp
Sourcepub fn with_context(
suppression_id: impl Into<String>,
action: AuditAction,
actor: impl Into<String>,
) -> Self
pub fn with_context( suppression_id: impl Into<String>, action: AuditAction, actor: impl Into<String>, ) -> Self
Create with full environment context
Sourcepub fn severity(self, severity: AuditSeverity) -> Self
pub fn severity(self, severity: AuditSeverity) -> Self
Set severity
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Set description
Sourcepub fn add_change(self, change: FieldChange) -> Self
pub fn add_change(self, change: FieldChange) -> Self
Add a field change
Add a related event
Sourcepub fn actor_email(self, email: impl Into<String>) -> Self
pub fn actor_email(self, email: impl Into<String>) -> Self
Set actor email
Sourcepub fn parsed_timestamp(&self) -> Option<DateTime<Utc>>
pub fn parsed_timestamp(&self) -> Option<DateTime<Utc>>
Parse timestamp to chrono DateTime
Sourcepub fn relative_time(&self) -> String
pub fn relative_time(&self) -> String
Get a human-readable relative time (e.g., “2 hours ago”)
Sourcepub fn format_summary(&self) -> String
pub fn format_summary(&self) -> String
Format for display
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Source§fn clone(&self) -> AuditEvent
fn clone(&self) -> AuditEvent
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 moreSource§impl Debug for AuditEvent
impl Debug for AuditEvent
Source§impl<'de> Deserialize<'de> for AuditEvent
impl<'de> Deserialize<'de> for AuditEvent
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 AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnwindSafe for AuditEvent
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