pub struct MessageEnvelope { /* private fields */ }Expand description
Metadata carried alongside every dispatch.
The envelope exposes the message type name and identifiers without
requiring the middleware to know the concrete Command or Query type.
Implementations§
Source§impl MessageEnvelope
impl MessageEnvelope
Sourcepub fn for_command<C: Command>(
message_id: MessageId,
correlation_id: CorrelationId,
) -> Self
pub fn for_command<C: Command>( message_id: MessageId, correlation_id: CorrelationId, ) -> Self
Builds an envelope for a Command dispatch.
Sourcepub fn for_query<Q: Query>(
message_id: MessageId,
correlation_id: CorrelationId,
) -> Self
pub fn for_query<Q: Query>( message_id: MessageId, correlation_id: CorrelationId, ) -> Self
Builds an envelope for a Query dispatch.
Sourcepub fn type_name(&self) -> &'static str
pub fn type_name(&self) -> &'static str
The fully-qualified type name of the dispatched message.
Sourcepub fn message_id(&self) -> MessageId
pub fn message_id(&self) -> MessageId
The unique identifier of this dispatch.
Sourcepub fn correlation_id(&self) -> CorrelationId
pub fn correlation_id(&self) -> CorrelationId
The correlation identifier linking this dispatch to its causal chain.
Trait Implementations§
Source§impl Clone for MessageEnvelope
impl Clone for MessageEnvelope
Source§fn clone(&self) -> MessageEnvelope
fn clone(&self) -> MessageEnvelope
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 moreAuto Trait Implementations§
impl Freeze for MessageEnvelope
impl RefUnwindSafe for MessageEnvelope
impl Send for MessageEnvelope
impl Sync for MessageEnvelope
impl Unpin for MessageEnvelope
impl UnsafeUnpin for MessageEnvelope
impl UnwindSafe for MessageEnvelope
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