pub struct Uuidv7Generator { /* private fields */ }Expand description
Stateful UUIDv7 ID generator shared by media discovery and translation.
Calling Uuidv7Generator::next_id sleeps for at least 1ms when the
previous call observed the same millisecond, guaranteeing strictly
increasing unix_time_ts values across all IDs produced by a single
generator instance.
Implementations§
Source§impl Uuidv7Generator
impl Uuidv7Generator
Sourcepub fn next_id(&mut self) -> Uuid
pub fn next_id(&mut self) -> Uuid
Generate the next UUIDv7 ID with strict 1ms spacing.
The implementation extracts the embedded unix_time_ts from the
generated UUIDv7. If the new timestamp is not strictly greater than
the previous one, the thread sleeps long enough for the next call to
land in a later millisecond, then retries.
Trait Implementations§
Source§impl Debug for Uuidv7Generator
impl Debug for Uuidv7Generator
Source§impl Default for Uuidv7Generator
impl Default for Uuidv7Generator
Source§fn default() -> Uuidv7Generator
fn default() -> Uuidv7Generator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Uuidv7Generator
impl RefUnwindSafe for Uuidv7Generator
impl Send for Uuidv7Generator
impl Sync for Uuidv7Generator
impl Unpin for Uuidv7Generator
impl UnsafeUnpin for Uuidv7Generator
impl UnwindSafe for Uuidv7Generator
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