pub struct UuidV7 { /* private fields */ }Expand description
An RFC 9562 time-ordered 128-bit UUIDv7 identifier.
Implementations§
Source§impl UuidV7
Core accessors and zero-allocation hex codecs for UuidV7.
impl UuidV7
Core accessors and zero-allocation hex codecs for UuidV7.
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> Self
pub const fn from_bytes(bytes: [u8; 16]) -> Self
Sourcepub const fn timestamp_ms(self) -> u64
pub const fn timestamp_ms(self) -> u64
Returns the embedded 48-bit Unix timestamp in milliseconds.
§Returns
u64- Unix timestamp in milliseconds.
Sourcepub const fn version(self) -> u8
pub const fn version(self) -> u8
Returns the 4-bit UUID version nibble (7 for valid RFC 9562 UUIDv7).
§Returns
u8- Version field (0..=15).
Sourcepub const fn sequence(self) -> u16
pub const fn sequence(self) -> u16
Returns the 12-bit monotonic rand_a sequence counter.
§Returns
u16- 12-bit sub-millisecond counter (0..=4095).
Sourcepub const fn encode_stack(self) -> [u8; 36]
pub const fn encode_stack(self) -> [u8; 36]
Encodes the UUIDv7 into a canonical 36-byte hyphenated lowercase ASCII stack buffer.
§Returns
[u8; UUID_STR_LEN]- Canonicalxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxbytes.
Trait Implementations§
impl Copy for UuidV7
impl Eq for UuidV7
Source§impl Ord for UuidV7
impl Ord for UuidV7
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UuidV7
impl PartialOrd for UuidV7
impl StructuralPartialEq for UuidV7
Auto Trait Implementations§
impl Forget for UuidV7
impl Freeze for UuidV7
impl Move for UuidV7
impl RefUnwindSafe for UuidV7
impl Send for UuidV7
impl Sync for UuidV7
impl Unpin for UuidV7
impl UnsafeUnpin for UuidV7
impl UnwindSafe for UuidV7
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