pub struct AuditEvent {Show 14 fields
pub id: Uuid,
pub event_type: AuditEventType,
pub timestamp: DateTime<Utc>,
pub agent_id: Option<Uuid>,
pub data: Value,
pub hash: Hash,
pub previous_hash: Option<Hash>,
pub sequence_number: u64,
pub actor: ActorType,
pub rationale: Option<String>,
pub policy_version: Option<String>,
pub data_provenance_hash: Option<Hash>,
pub human_review_required: bool,
pub approval_signatures: Vec<Signature>,
}Expand description
Single audit event (ISO 42001 / EU AI Act compliant)
Fields§
§id: Uuid§event_type: AuditEventType§timestamp: DateTime<Utc>§agent_id: Option<Uuid>§data: Value§hash: Hash§previous_hash: Option<Hash>§sequence_number: u64§actor: ActorType§rationale: Option<String>§policy_version: Option<String>§data_provenance_hash: Option<Hash>§human_review_required: bool§approval_signatures: Vec<Signature>Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(
event_type: AuditEventType,
agent_id: Option<Uuid>,
data: Value,
sequence_number: u64,
) -> Self
pub fn new( event_type: AuditEventType, agent_id: Option<Uuid>, data: Value, sequence_number: u64, ) -> Self
Create a new audit event with sanitized data
Sourcepub fn sanitize_data(value: Value) -> Value
pub fn sanitize_data(value: Value) -> Value
Sanitize sensitive fields from audit data (HIGH-2 fix)
Sourcepub fn chained(
event_type: AuditEventType,
agent_id: Option<Uuid>,
data: Value,
previous_hash: Hash,
sequence_number: u64,
) -> Self
pub fn chained( event_type: AuditEventType, agent_id: Option<Uuid>, data: Value, previous_hash: Hash, sequence_number: u64, ) -> Self
Create with chained previous hash
pub fn compute_hash(params: HashParams<'_>) -> Hash
pub fn compute_chained_hash( base_hash: &Hash, prev_hash: &Hash, sequence: u64, ) -> Hash
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
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 more