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 moreSource§impl Debug for EventEnvelope
impl Debug for EventEnvelope
Source§impl<'de> Deserialize<'de> for EventEnvelope
impl<'de> Deserialize<'de> for EventEnvelope
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EventEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EventEnvelope
impl PartialEq for EventEnvelope
Source§impl Serialize for EventEnvelope
impl Serialize for EventEnvelope
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for EventEnvelope
Auto Trait Implementations§
impl Freeze for EventEnvelope
impl RefUnwindSafe for EventEnvelope
impl Send for EventEnvelope
impl Sync for EventEnvelope
impl Unpin for EventEnvelope
impl UnsafeUnpin for EventEnvelope
impl UnwindSafe for EventEnvelope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more