pub struct EventEnvelopeV1 {
pub schema_version: u16,
pub event_id: String,
pub correlation: EventCorrelationV1,
pub event: ProtocolEvent,
}Expand description
Stable metadata wrapper for one durable the host app event.
event_id is deterministically derived from the already-authoritative
(session_id, seq) pair, so replay/reopen produces the same identity. The
event payload remains unchanged and therefore backward-compatible.
Fields§
§schema_version: u16§event_id: String§correlation: EventCorrelationV1§event: ProtocolEventImplementations§
Source§impl EventEnvelopeV1
impl EventEnvelopeV1
Sourcepub fn canonical(event: ProtocolEvent) -> Result<Self, String>
pub fn canonical(event: ProtocolEvent) -> Result<Self, String>
Build the canonical normalized representation for a durable fact using
correlation already present on the event. Because event_id derives
from (session_id, seq), replay/reopen reconstructs the same identity
without a duplicate database column that could drift.
pub fn for_durable_event( event: ProtocolEvent, correlation: EventCorrelationV1, ) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for EventEnvelopeV1
impl Clone for EventEnvelopeV1
Source§impl Debug for EventEnvelopeV1
impl Debug for EventEnvelopeV1
Source§impl<'de> Deserialize<'de> for EventEnvelopeV1
impl<'de> Deserialize<'de> for EventEnvelopeV1
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 EventEnvelopeV1
impl RefUnwindSafe for EventEnvelopeV1
impl Send for EventEnvelopeV1
impl Sync for EventEnvelopeV1
impl Unpin for EventEnvelopeV1
impl UnsafeUnpin for EventEnvelopeV1
impl UnwindSafe for EventEnvelopeV1
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