pub struct MessageId(/* private fields */);Expand description
Unique message identifier.
Implementations§
Source§impl MessageId
impl MessageId
Sourcepub fn new() -> Self
pub fn new() -> Self
Generates a new random message ID.
Requires the std feature, which is what enables uuid’s v4: the
generator draws from getrandom, which has no backend on a bare-metal
target. Reconstruct ids from the wire with MessageId::from_bytes
instead.
Sourcepub fn as_bytes(&self) -> [u8; 16]
pub fn as_bytes(&self) -> [u8; 16]
Returns the 16-byte representation of the underlying UUID.
Used by the binary wire codec to carry the id as 16 raw bytes instead of the 36-character hyphenated string the JSON encoding uses.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Reconstructs a message id from its 16-byte representation.
Trait Implementations§
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
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> 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