#[non_exhaustive]pub struct CorrelationMetadata {
pub correlation_id: Option<CorrelationId>,
pub conversation_id: ConversationId,
pub causation_id: Option<MessageId>,
pub request_id: Option<RequestId>,
}Expand description
Correlation and conversation identity for one envelope.
use reliar_core::{CorrelationId, Envelope};
let envelope = Envelope::builder(Ping)
.correlation_id(CorrelationId::parse("checkout-42")?)
.build();
assert_eq!(envelope.metadata.correlation.correlation_id.unwrap().as_str(), "checkout-42");Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.correlation_id: Option<CorrelationId>Application/business workflow correlation, set by the caller.
conversation_id: ConversationIdGroups every message in one business conversation.
causation_id: Option<MessageId>The message that directly caused this one.
request_id: Option<RequestId>The inbound request that (transitively) caused this one.
Trait Implementations§
Source§impl Clone for CorrelationMetadata
impl Clone for CorrelationMetadata
Source§fn clone(&self) -> CorrelationMetadata
fn clone(&self) -> CorrelationMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CorrelationMetadata
impl Debug for CorrelationMetadata
Source§impl Default for CorrelationMetadata
Sets conversation_id to the ConversationId::UNSET sentinel (the nil UUID) — not a
fresh mint — so crate::EnvelopeBuilder::build can tell “not yet rooted” from a genuinely
chosen value by comparing it, not by tracking which builder setter was called.
build replaces UNSET with the envelope’s own id, so an un-correlated message is the root
of its own conversation, and leaves any other value alone. A Metadata that never passes
through the builder (e.g. read straight off Default) keeps the placeholder verbatim.
impl Default for CorrelationMetadata
Sets conversation_id to the ConversationId::UNSET sentinel (the nil UUID) — not a
fresh mint — so crate::EnvelopeBuilder::build can tell “not yet rooted” from a genuinely
chosen value by comparing it, not by tracking which builder setter was called.
build replaces UNSET with the envelope’s own id, so an un-correlated message is the root
of its own conversation, and leaves any other value alone. A Metadata that never passes
through the builder (e.g. read straight off Default) keeps the placeholder verbatim.
Source§impl<'de> Deserialize<'de> for CorrelationMetadata
Available on crate feature serde only.
impl<'de> Deserialize<'de> for CorrelationMetadata
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl PartialEq for CorrelationMetadata
impl PartialEq for CorrelationMetadata
Source§impl Serialize for CorrelationMetadata
Available on crate feature serde only.
impl Serialize for CorrelationMetadata
serde only.