pub struct Context { /* private fields */ }
Expand description
A thread-safe, wrapping counter that produces 14-bit numbers.
This type should be used when constructing version 1 and version 6 UUIDs.
Implementations§
source§impl Context
impl Context
sourcepub const fn new(count: u16) -> Self
pub const fn new(count: u16) -> Self
Construct a new context that’s initialized with the given value.
The starting value should be a random number, so that UUIDs from
different systems with the same timestamps are less likely to collide.
When the rng
feature is enabled, prefer the Context::new_random
method.
sourcepub fn new_random() -> Self
pub fn new_random() -> Self
Construct a new context that’s initialized with a random value.