pub struct AuditEvent {
pub ts: String,
pub action: AuditAction,
pub coordinate: Option<String>,
pub environment: Option<String>,
pub result: String,
pub origin: Option<String>,
pub fingerprint: Option<String>,
pub requester_note: Option<String>,
}Expand description
One append-only audit entry. No field ever holds a value (I12); any fingerprint is the truncated form (§10.4).
Fields§
§ts: StringRFC-3339 UTC timestamp.
action: AuditActionWhat happened.
coordinate: Option<String>The coordinate acted on (an address, never a value).
environment: Option<String>Environment.
result: StringOutcome / result text (e.g. allowed, denied:McpCriticalForbidden).
origin: Option<String>Who initiated it (agent / human).
fingerprint: Option<String>Truncated fingerprint (§10.4); never the full hash, never the value.
requester_note: Option<String>Requester-supplied note, segregated as untrusted (mirrors I16).
Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(
clock: &dyn Clock,
action: AuditAction,
result: impl Into<String>,
) -> Self
pub fn new( clock: &dyn Clock, action: AuditAction, result: impl Into<String>, ) -> Self
Start an event stamped now by the clock.
Sourcepub fn at(
self,
coordinate: impl Into<String>,
environment: impl Into<String>,
) -> Self
pub fn at( self, coordinate: impl Into<String>, environment: impl Into<String>, ) -> Self
Record which coordinate (address) and environment the event concerns.
Sourcepub fn with_fingerprint(self, truncated: impl Into<String>) -> Self
pub fn with_fingerprint(self, truncated: impl Into<String>) -> Self
Record a truncated fingerprint (callers must pass the truncated form
from [crate::fingerprint], never a full hash or a value).
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 (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 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
Source§impl PartialEq for AuditEvent
impl PartialEq for AuditEvent
Source§fn eq(&self, other: &AuditEvent) -> bool
fn eq(&self, other: &AuditEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AuditEvent
impl Serialize for AuditEvent
impl StructuralPartialEq for AuditEvent
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