pub struct Id<K> { /* private fields */ }Expand description
A phantom-typed ID wrapper that provides type safety across domains.
The type parameter K is a phantom type that exists only at compile time
to prevent mixing IDs from different domains.
Implementations§
Source§impl<K> Id<K>
impl<K> Id<K>
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Create from raw bytes.
Sourcepub fn timestamp_ms(&self) -> u64
pub fn timestamp_ms(&self) -> u64
Get the timestamp in milliseconds.
Trait Implementations§
Source§impl<K> Ord for Id<K>
impl<K> Ord for Id<K>
Source§impl<K> PartialOrd for Id<K>
impl<K> PartialOrd for Id<K>
impl<K: Copy> Copy for Id<K>
impl<K> Eq for Id<K>
Auto Trait Implementations§
impl<K> Freeze for Id<K>
impl<K> RefUnwindSafe for Id<K>where
K: RefUnwindSafe,
impl<K> Send for Id<K>where
K: Send,
impl<K> Sync for Id<K>where
K: Sync,
impl<K> Unpin for Id<K>where
K: Unpin,
impl<K> UnsafeUnpin for Id<K>
impl<K> UnwindSafe for Id<K>where
K: UnwindSafe,
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