pub struct CorrelationId(/* private fields */);Expand description
Groups all events and commands that originate from the same root operation.
Implementations§
Source§impl CorrelationId
impl CorrelationId
Source§impl CorrelationId
impl CorrelationId
Sourcepub fn from_interchange_ref(interchange_ref: &str) -> Self
pub fn from_interchange_ref(interchange_ref: &str) -> Self
Derive a deterministic CorrelationId from an EDIFACT interchange
reference string using UUID v5 (SHA-1 hash in a fixed namespace).
EDIFACT interchanges carry a reference number in UNB+…+…+<ref>.
Messages retransmitted with the same reference must produce the same
CorrelationId so duplicate EDIFACT messages are correlated correctly
in traces and never generate spurious new process roots.
The namespace UUID is fixed and private to this crate:
a3c7e1f0-5b2d-4e80-9f6a-1b3c5d7e9a0b (registered once).
§Example
use mako_engine::ids::CorrelationId;
let id = CorrelationId::from_interchange_ref("A000123");
// Same reference → same CorrelationId (idempotent dispatch).
assert_eq!(id, CorrelationId::from_interchange_ref("A000123"));
// Different reference → different CorrelationId.
assert_ne!(id, CorrelationId::from_interchange_ref("A000124"));Trait Implementations§
Source§impl Clone for CorrelationId
impl Clone for CorrelationId
Source§fn clone(&self) -> CorrelationId
fn clone(&self) -> CorrelationId
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 moreimpl Copy for CorrelationId
Source§impl Debug for CorrelationId
impl Debug for CorrelationId
Source§impl Default for CorrelationId
impl Default for CorrelationId
Source§impl<'de> Deserialize<'de> for CorrelationId
impl<'de> Deserialize<'de> for CorrelationId
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
Source§impl Display for CorrelationId
impl Display for CorrelationId
impl Eq for CorrelationId
Source§impl From<CorrelationId> for CausationId
impl From<CorrelationId> for CausationId
Source§fn from(id: CorrelationId) -> Self
fn from(id: CorrelationId) -> Self
Treat a correlation root as the direct cause (useful for first events).
Source§impl From<Uuid> for CorrelationId
impl From<Uuid> for CorrelationId
Source§impl Hash for CorrelationId
impl Hash for CorrelationId
Source§impl Ord for CorrelationId
impl Ord for CorrelationId
Source§fn cmp(&self, other: &CorrelationId) -> Ordering
fn cmp(&self, other: &CorrelationId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CorrelationId
impl PartialEq for CorrelationId
Source§fn eq(&self, other: &CorrelationId) -> bool
fn eq(&self, other: &CorrelationId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CorrelationId
impl PartialOrd for CorrelationId
Source§impl Serialize for CorrelationId
impl Serialize for CorrelationId
impl StructuralPartialEq for CorrelationId
Auto Trait Implementations§
impl Freeze for CorrelationId
impl RefUnwindSafe for CorrelationId
impl Send for CorrelationId
impl Sync for CorrelationId
impl Unpin for CorrelationId
impl UnsafeUnpin for CorrelationId
impl UnwindSafe for CorrelationId
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