pub struct EventRecord { /* private fields */ }Expand description
One serialized history line. Fields private: the only paths to a
record are EventRecord::from_draft (append side) and
EventRecord::parse_line (read side).
Implementations§
Source§impl EventRecord
impl EventRecord
Sourcepub fn moment(&self) -> Option<TimeMs>
pub fn moment(&self) -> Option<TimeMs>
This line’s own moment: Some(t) for a kind that
records_a_moment, written at a
version that measures it; None for every other line. A None on
one of those four kinds means the moment was not measured, not
that it took no time.
Source§impl EventRecord
impl EventRecord
Sourcepub fn from_draft(draft: EventDraft, seq: Seq, prev: B3Hash) -> Self
pub fn from_draft(draft: EventDraft, seq: Seq, prev: B3Hash) -> Self
Append-side assembly: the caller (a Ledger implementation) owns seq
and prev; v is pinned to EVENT_LOG_V.
Sourcepub fn canonical_line(&self) -> Result<Vec<u8>, AxError>
pub fn canonical_line(&self) -> Result<Vec<u8>, AxError>
The canonical bytes (no line terminator). The one byte producer library-wide; adapters append these bytes verbatim and hash exactly them for the next line’s prev.
Sourcepub fn parse_line(raw: &[u8]) -> Result<Self, AxError>
pub fn parse_line(raw: &[u8]) -> Result<Self, AxError>
Read-side entrance: full field revalidation, fail-closed. Unknown
kinds fail here; the ig:true skip belongs to replay, which probes
the envelope before committing to a typed parse.
Sourcepub fn to_ref(&self) -> EventRef
pub fn to_ref(&self) -> EventRef
Minting a reference requires holding a whole record (15.3-1): the append path holds what it just assembled, replay holds what it just verified. There is no third path.