pub struct EventEnvelope {
pub run_id: RunId,
pub seq: SequenceNumber,
pub schema_version: u32,
pub recorded_at: OffsetDateTime,
pub event: Event,
}Expand description
One record in a run’s append-only log.
The envelope carries run identity, the event’s position in the log, the
schema version, when it was recorded, and the payload that says what
happened. Serializing an envelope always includes schema_version, so the
wire form is self-describing.
Fields§
§run_id: RunIdThe run this event belongs to.
seq: SequenceNumberThis event’s monotonic position in the run’s log.
schema_version: u32The event schema version. Always SCHEMA_VERSION for events this
build writes; older values may appear when reading an old log.
recorded_at: OffsetDateTimeWhen the event was recorded, as an RFC 3339 timestamp on the wire.
Passed in by the caller. Nothing in this crate reads the clock.
event: EventWhat happened.
Implementations§
Source§impl EventEnvelope
impl EventEnvelope
Sourcepub const fn new(
run_id: RunId,
seq: SequenceNumber,
recorded_at: OffsetDateTime,
event: Event,
) -> EventEnvelope
pub const fn new( run_id: RunId, seq: SequenceNumber, recorded_at: OffsetDateTime, event: Event, ) -> EventEnvelope
Wraps a payload with its run identity, log position, and recorded
timestamp, stamping the current SCHEMA_VERSION.
The timestamp is a parameter on purpose: this constructor never reads the clock, so it stays usable from the pure replay path.
Trait Implementations§
Source§impl Clone for EventEnvelope
impl Clone for EventEnvelope
Source§fn clone(&self) -> EventEnvelope
fn clone(&self) -> EventEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more