pub struct Uuid(_);Expand description
Represents a Universally Unique IDentifier.
Implementations§
source§impl Uuid
impl Uuid
sourcepub const fn from_fields_v7(unix_ts_ms: u64, rand_a: u16, rand_b: u64) -> Self
pub const fn from_fields_v7(unix_ts_ms: u64, rand_a: u16, rand_b: u64) -> Self
Creates a UUID byte array from UUIDv7 field values.
sourcepub fn encode(&self) -> FStr<36>
pub fn encode(&self) -> FStr<36>
Returns the 8-4-4-4-12 hexadecimal string representation stored in a stack-allocated
string-like type that can be handled like String through common traits.
This method is primarily for no_std environments where heap-allocated string types are
not readily available. Use the fmt::Display trait usually to get the 8-4-4-4-12
canonical hexadecimal string representation.
Examples
use uuid7::Uuid;
let x = "01809424-3e59-7c05-9219-566f82fff672".parse::<Uuid>()?;
let y = x.encode();
assert_eq!(y, "01809424-3e59-7c05-9219-566f82fff672");
assert_eq!(format!("{y}"), "01809424-3e59-7c05-9219-566f82fff672");Trait Implementations§
source§impl<'de> Deserialize<'de> for Uuid
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Uuid
Available on crate feature
serde only.source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Uuid
impl Ord for Uuid
source§impl PartialEq<Uuid> for Uuid
impl PartialEq<Uuid> for Uuid
source§impl PartialOrd<Uuid> for Uuid
impl PartialOrd<Uuid> for Uuid
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more