pub struct AuditEvent {
pub timestamp: DateTime<Utc>,
pub event_id: String,
pub event_type: AuditEventType,
pub actor: Option<Actor>,
pub action: Option<Action>,
pub result: Option<ExecutionResult>,
pub security: SecurityContext,
}Expand description
Complete audit event
Fields§
§timestamp: DateTime<Utc>§event_id: String§event_type: AuditEventType§actor: Option<Actor>§action: Option<Action>§result: Option<ExecutionResult>§security: SecurityContextImplementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(event_type: AuditEventType) -> Self
pub fn new(event_type: AuditEventType) -> Self
Create a new audit event
Sourcepub fn with_actor(self, actor: Actor) -> Self
pub fn with_actor(self, actor: Actor) -> Self
Set the actor
Sourcepub fn with_action(self, action: Action) -> Self
pub fn with_action(self, action: Action) -> Self
Set the action
Sourcepub fn with_result(self, result: ExecutionResult) -> Self
pub fn with_result(self, result: ExecutionResult) -> Self
Set the result
Sourcepub fn with_security(self, security: SecurityContext) -> Self
pub fn with_security(self, security: SecurityContext) -> Self
Set security context
Sourcepub fn as_violation(self) -> Self
pub fn as_violation(self) -> Self
Mark as policy violation
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