[−][src]Struct nson::message_id::MessageId
Implementations
impl MessageId
[src]
pub fn new() -> MessageId
[src]
Generate a new MessageId
Examples
use nson::message_id::MessageId; let id = MessageId::new(); println!("{:?}", id);
pub fn with_bytes(bytes: [u8; 16]) -> Self
[src]
Generate an MessageId with bytes
Examples
use nson::message_id::MessageId; let id = MessageId::with_bytes([1, 111, 157, 189, 157, 247, 247, 220, 156, 134, 213, 115, 239, 90, 50, 156]); assert_eq!(format!("{}", id), "016f9dbd9df7f7dc9c86d573ef5a329c")
pub fn with_string(str: &str) -> Result<MessageId>
[src]
Generate an MessageId with string. Provided string must be a 12-byte hexadecimal string
Examples
use nson::message_id::MessageId; let id = MessageId::with_string("016f9dbd9df7f7dc9c86d573ef5a329c").unwrap(); assert_eq!(format!("{}", id), "016f9dbd9df7f7dc9c86d573ef5a329c")
pub fn bytes(&self) -> [u8; 16]
[src]
16-byte binary representation of this MessageId.
pub fn timestamp(&self) -> u64
[src]
Timstamp of this MessageId
pub fn counter(&self) -> u16
[src]
pub fn random(&self) -> u32
[src]
pub fn identify(&self) -> u32
[src]
pub fn to_hex(&self) -> String
[src]
Convert this MessageId to a 16-byte hexadecimal string.
pub fn zero() -> MessageId
[src]
pub fn is_zero(&self) -> bool
[src]
Trait Implementations
impl Clone for MessageId
[src]
impl Copy for MessageId
[src]
impl Debug for MessageId
[src]
impl Default for MessageId
[src]
impl<'de> Deserialize<'de> for MessageId
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for MessageId
[src]
impl Eq for MessageId
[src]
impl<'a> From<&'a MessageId> for Value
[src]
impl From<[u8; 16]> for MessageId
[src]
impl From<MessageId> for Value
[src]
impl Hash for MessageId
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for MessageId
[src]
fn cmp(&self, other: &MessageId) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<MessageId> for MessageId
[src]
impl PartialOrd<MessageId> for MessageId
[src]
fn partial_cmp(&self, other: &MessageId) -> Option<Ordering>
[src]
fn lt(&self, other: &MessageId) -> bool
[src]
fn le(&self, other: &MessageId) -> bool
[src]
fn gt(&self, other: &MessageId) -> bool
[src]
fn ge(&self, other: &MessageId) -> bool
[src]
impl Serialize for MessageId
[src]
impl StructuralEq for MessageId
[src]
impl StructuralPartialEq for MessageId
[src]
Auto Trait Implementations
impl RefUnwindSafe for MessageId
impl Send for MessageId
impl Sync for MessageId
impl Unpin for MessageId
impl UnwindSafe for MessageId
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,