pub struct AgentEventEnvelope {
pub event_id: Uuid,
pub sequence: u64,
pub timestamp: OffsetDateTime,
pub event: AgentEvent,
}Expand description
Envelope wrapping every AgentEvent with idempotency metadata.
Mobile clients can use event_id for deduplication on retry, sequence
for ordering after persistence, and timestamp for display.
The event field is flattened in JSON so that event_id, sequence,
timestamp, and the event’s type discriminant all appear at the same level.
Fields§
§event_id: UuidUnique identifier (UUID v4) for this event emission.
sequence: u64Monotonically increasing sequence number within a single run.
timestamp: OffsetDateTimeUTC timestamp of when the event was emitted.
event: AgentEventThe actual event payload.
Implementations§
Source§impl AgentEventEnvelope
impl AgentEventEnvelope
Sourcepub fn wrap(event: AgentEvent, seq: &SequenceCounter) -> Self
pub fn wrap(event: AgentEvent, seq: &SequenceCounter) -> Self
Wrap an AgentEvent in an envelope, assigning it a unique ID,
the next sequence number, and the current UTC timestamp.
Trait Implementations§
Source§impl Clone for AgentEventEnvelope
impl Clone for AgentEventEnvelope
Source§fn clone(&self) -> AgentEventEnvelope
fn clone(&self) -> AgentEventEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AgentEventEnvelope
impl Debug for AgentEventEnvelope
Source§impl<'de> Deserialize<'de> for AgentEventEnvelope
impl<'de> Deserialize<'de> for AgentEventEnvelope
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 AgentEventEnvelope
impl RefUnwindSafe for AgentEventEnvelope
impl Send for AgentEventEnvelope
impl Sync for AgentEventEnvelope
impl Unpin for AgentEventEnvelope
impl UnsafeUnpin for AgentEventEnvelope
impl UnwindSafe for AgentEventEnvelope
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