pub struct Envelope {
pub message_id: MessageId,
pub payload: Vec<u8>,
pub causal_context: Option<CausalContext>,
pub schema_id: SchemaId,
pub publisher_id: PublisherId,
pub timestamp: DateTime<Utc>,
}Expand description
Message envelope used as the delivery unit inside the core bus.
Fields§
§message_id: MessageIdUUID-based unique identifier assigned when the message is published.
payload: Vec<u8>Validated payload bytes, normalized by the schema when defaults are applied.
causal_context: Option<CausalContext>Optional parent reference for causal-chain metadata.
schema_id: SchemaIdSchema version that validated this payload.
publisher_id: PublisherIdPublisher identity attached at publish time.
timestamp: DateTime<Utc>UTC timestamp captured when the message was published.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn new(
payload: Vec<u8>,
causal_context: Option<CausalContext>,
schema_id: SchemaId,
publisher_id: PublisherId,
) -> Self
pub fn new( payload: Vec<u8>, causal_context: Option<CausalContext>, schema_id: SchemaId, publisher_id: PublisherId, ) -> Self
Creates an envelope with the current UTC publish timestamp.
Sourcepub fn with_timestamp(
payload: Vec<u8>,
causal_context: Option<CausalContext>,
schema_id: SchemaId,
publisher_id: PublisherId,
timestamp: DateTime<Utc>,
) -> Self
pub fn with_timestamp( payload: Vec<u8>, causal_context: Option<CausalContext>, schema_id: SchemaId, publisher_id: PublisherId, timestamp: DateTime<Utc>, ) -> Self
Creates an envelope with an explicit timestamp.
Sourcepub fn with_message_id(
message_id: MessageId,
payload: Vec<u8>,
causal_context: Option<CausalContext>,
schema_id: SchemaId,
publisher_id: PublisherId,
) -> Self
pub fn with_message_id( message_id: MessageId, payload: Vec<u8>, causal_context: Option<CausalContext>, schema_id: SchemaId, publisher_id: PublisherId, ) -> Self
Creates an envelope with an explicit message identifier and current UTC timestamp.
Sourcepub const fn with_message_id_and_timestamp(
message_id: MessageId,
payload: Vec<u8>,
causal_context: Option<CausalContext>,
schema_id: SchemaId,
publisher_id: PublisherId,
timestamp: DateTime<Utc>,
) -> Self
pub const fn with_message_id_and_timestamp( message_id: MessageId, payload: Vec<u8>, causal_context: Option<CausalContext>, schema_id: SchemaId, publisher_id: PublisherId, timestamp: DateTime<Utc>, ) -> Self
Creates an envelope with explicit message identifier and timestamp.
Trait Implementations§
impl Eq for Envelope
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.