pub struct MessageId(/* private fields */);Expand description
A unique message identifier using TypeID format.
Format: msg_<uuid_v7>
Example: msg_01h455vb4pex5vsknk084sn02q
MessageIds are time-sortable (UUIDv7) and self-describing with the msg_ prefix.
Implementations§
Source§impl MessageId
impl MessageId
Sourcepub fn parse(s: &str) -> Result<Self, InvalidMessageId>
pub fn parse(s: &str) -> Result<Self, InvalidMessageId>
Parses a message ID from a string, validating the prefix.
§Errors
Returns an error if the string is not a valid TypeID or has the wrong prefix.
Sourcepub fn inner(&self) -> &MagicTypeId
pub fn inner(&self) -> &MagicTypeId
Returns the underlying MagicTypeId.
Trait Implementations§
Source§impl AsRef<MagicTypeId> for MessageId
impl AsRef<MagicTypeId> for MessageId
Source§fn as_ref(&self) -> &MagicTypeId
fn as_ref(&self) -> &MagicTypeId
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for MessageId
impl<'de> Deserialize<'de> for MessageId
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 From<&MessageId> for CausationId
Allow converting a reference to MessageId to CausationId.
impl From<&MessageId> for CausationId
Allow converting a reference to MessageId to CausationId.
Source§impl From<MessageId> for CausationId
Allow converting MessageId to CausationId.
impl From<MessageId> for CausationId
Allow converting MessageId to CausationId.
This is a common pattern where the ID of the message that triggered a new message becomes the causation ID of that new message.
impl Eq for MessageId
impl StructuralPartialEq for MessageId
Auto Trait Implementations§
impl Freeze for MessageId
impl RefUnwindSafe for MessageId
impl Send for MessageId
impl Sync for MessageId
impl Unpin for MessageId
impl UnsafeUnpin for MessageId
impl UnwindSafe for MessageId
Blanket Implementations§
Source§impl<T> ActonMessage for T
impl<T> ActonMessage for T
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
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§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.