pub struct EventEnvelope {
pub event_name: EventName,
pub event_id: String,
pub app_id: AppId,
pub node_id: NodeId,
pub occurred_at_ms: u64,
pub payload: Vec<u8>,
pub trace: Option<TraceContext>,
}Expand description
Immutable event envelope.
Fields§
§event_name: EventNameStable event name.
event_id: StringUnique event identity.
app_id: AppIdApplication that emitted the event.
node_id: NodeIdNode that emitted the event.
occurred_at_ms: u64Occurrence timestamp in Unix milliseconds.
payload: Vec<u8>Opaque application-owned payload.
trace: Option<TraceContext>Optional distributed trace context.
Implementations§
Source§impl EventEnvelope
impl EventEnvelope
Sourcepub fn new(
event_name: EventName,
event_id: String,
app_id: AppId,
node_id: NodeId,
occurred_at_ms: u64,
payload: Vec<u8>,
) -> RuntimeResult<Self>
pub fn new( event_name: EventName, event_id: String, app_id: AppId, node_id: NodeId, occurred_at_ms: u64, payload: Vec<u8>, ) -> RuntimeResult<Self>
Creates and validates an event envelope.
Sourcepub fn with_trace(self, trace: TraceContext) -> Self
pub fn with_trace(self, trace: TraceContext) -> Self
Attaches distributed trace context.
Sourcepub fn event_name(&self) -> &EventName
pub fn event_name(&self) -> &EventName
Returns the event name.
Trait Implementations§
Source§impl Clone for EventEnvelope
impl Clone for EventEnvelope
Source§fn clone(&self) -> EventEnvelope
fn clone(&self) -> EventEnvelope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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<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
impl Eq for EventEnvelope
Source§impl PartialEq for EventEnvelope
impl PartialEq for EventEnvelope
Source§impl Serialize for EventEnvelope
impl Serialize for EventEnvelope
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
Mutably borrows from an owned value. Read more