pub struct Event {
pub event_id: EventId,
pub run_id: RunId,
pub ts: OffsetDateTime,
pub parent_event_id: Option<EventId>,
pub kind: String,
pub schema_version: u32,
pub payload: Value,
pub origin: Option<String>,
pub hlc: Option<String>,
}Fields§
§event_id: EventId§run_id: RunId§ts: OffsetDateTime§parent_event_id: Option<EventId>§kind: String§schema_version: u32§payload: Value§origin: Option<String>Who/where wrote this event: <machine_id>/<agent>, or None for events
created before origin tracking (schema < v8) or when unconfigured.
Auto-stamped from process_origin by Event::new; preserved verbatim
across rebuild and sync replication.
hlc: Option<String>v2.6 #3 Slice B: Hybrid Logical Clock timestamp (canonical string) giving
a globally-deterministic, causal total order for convergent team sync.
None for events created before HLC tracking (schema < v9); the v9
migration backfills those from (ts, rowid). Auto-stamped by
Event::new; preserved verbatim across rebuild and replication.
Implementations§
Source§impl Event
impl Event
pub fn new(run_id: RunId, kind: impl Into<String>, payload: Value) -> Self
pub fn with_parent(self, parent_event_id: EventId) -> Self
Sourcepub fn with_origin(self, origin: Option<String>) -> Self
pub fn with_origin(self, origin: Option<String>) -> Self
Override the origin (used by the sync import path to preserve a remote event’s origin instead of stamping the local process origin).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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 Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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