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
sourceimpl 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.
Trait Implementations
sourceimpl ClockSequence for Context
impl ClockSequence for Context
Auto Trait Implementations
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more