pub struct AuditEvent {
pub id: String,
pub timestamp: DateTime<Utc>,
pub action: AuditAction,
pub box_id: Option<String>,
pub actor: String,
pub outcome: AuditOutcome,
pub message: Option<String>,
pub metadata: HashMap<String, Value>,
}Expand description
A structured audit event capturing a security-relevant action.
Follows the W7 model: Who, What, When, Where, Why, hoW, outcome.
Fields§
§id: StringUnique event ID.
timestamp: DateTime<Utc>ISO 8601 timestamp.
action: AuditActionAction category.
box_id: Option<String>Target box ID (if applicable).
actor: StringActor who initiated the action (e.g., “cli”, “sdk”, “cri”, “system”).
outcome: AuditOutcomeOutcome of the action.
message: Option<String>Human-readable description.
metadata: HashMap<String, Value>Additional structured metadata.
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(action: AuditAction, outcome: AuditOutcome) -> Self
pub fn new(action: AuditAction, outcome: AuditOutcome) -> Self
Create a new audit event.
Sourcepub fn with_box_id(self, box_id: impl Into<String>) -> Self
pub fn with_box_id(self, box_id: impl Into<String>) -> Self
Set the box ID.
Sourcepub fn with_actor(self, actor: impl Into<String>) -> Self
pub fn with_actor(self, actor: impl Into<String>) -> Self
Set the actor.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Set a human-readable message.
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 UnsafeUnpin 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