pub struct UlidGenerator { /* private fields */ }Expand description
Lock-free monotonic 128-bit ULID generator using atomic state and SplitMix64 entropy.
Implementations§
Source§impl UlidGenerator
Lock-free monotonic generation methods for UlidGenerator.
impl UlidGenerator
Lock-free monotonic generation methods for UlidGenerator.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new lock-free UlidGenerator seeded from system time and instance address.
§Returns
Self- Ready lock-free ULID generator.
Sourcepub fn with_seed(seed: u64) -> Self
pub fn with_seed(seed: u64) -> Self
Creates a deterministic UlidGenerator with an explicit 64-bit initial entropy seed.
§Arguments
u64- Initial 64-bit PRNG seed.
§Returns
Self- Ready ULID generator.
Trait Implementations§
Source§impl Debug for UlidGenerator
impl Debug for UlidGenerator
Source§impl Default for UlidGenerator
Default construction for UlidGenerator.
impl Default for UlidGenerator
Default construction for UlidGenerator.
Source§fn default() -> Self
fn default() -> Self
Creates a new UlidGenerator seeded from wall-clock entropy and stack address.
§Returns
Self- Ready lock-free ULID generator.
Auto Trait Implementations§
impl !Freeze for UlidGenerator
impl Forget for UlidGenerator
impl Move for UlidGenerator
impl RefUnwindSafe for UlidGenerator
impl Send for UlidGenerator
impl Sync for UlidGenerator
impl Unpin for UlidGenerator
impl UnsafeUnpin for UlidGeneratorwhere
Align8<u64>: UnsafeUnpin,
impl UnwindSafe for UlidGeneratorwhere
Align8<u64>: 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