pub struct Event { /* private fields */ }Expand description
An owned, non-model-visible audit fact.
Implementations§
Source§impl Event
impl Event
Sourcepub const fn new(kind: String, payload: Option<Box<[u8]>>) -> Self
pub const fn new(kind: String, payload: Option<Box<[u8]>>) -> Self
Creates an audit fact from its producer-defined kind and optional payload.
The payload is retained verbatim and is not parsed or canonicalized.
Trait Implementations§
Source§impl Debug for Event
impl Debug for Event
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Names the kind and sizes the payload, never printing a payload byte.
kind is a producer-supplied classification (ADR-018 Tier 1) and prints
verbatim. payload is owned opaque bytes (Tier 2), so it renders as its
length and never its content; the three states None, Some(<0 bytes>)
and Some(<N bytes>) stay distinct, because the whole reason this type
keeps Option is that “attached nothing” and “attached an empty blob”
are two different facts (ADR-019 D5). The bytes are the very lane this
module exists to keep off the model-visible path, so a derived Debug
would put them back on the one that reaches logs and dbg!.