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) -> EventRecord
pub fn from_draft(draft: EventDraft, seq: Seq, prev: B3Hash) -> EventRecord
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<EventRecord, AxError>
pub fn parse_line(raw: &[u8]) -> Result<EventRecord, 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.
pub fn v(&self) -> u32
pub fn run(&self) -> RunId
pub fn seq(&self) -> Seq
pub fn prev(&self) -> B3Hash
pub fn t(&self) -> TimeMs
pub fn who(&self) -> &str
pub fn addr(&self) -> Option<&Address>
pub fn kind(&self) -> EventKind
pub fn data(&self) -> &Payload
pub fn ig(&self) -> bool
Trait Implementations§
Source§impl Clone for EventRecord
impl Clone for EventRecord
Source§fn clone(&self) -> EventRecord
fn clone(&self) -> EventRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more