Skip to main content

atomic_snowflake/
lib.rs

1//! atomic-snowflake
2//!
3//! Zero-dependency lock-free monotonic 64-bit Snowflake ID, 128-bit ULID, and
4//! RFC 9562 UUIDv7 generators with zero-allocation stack codecs.
5
6mod error;
7mod snowflake;
8mod ulid;
9mod uuidv7;
10
11pub use {error::*, snowflake::*, ulid::*, uuidv7::*};
12
13pub(crate) use snowflake::{current_unix_ms, splitmix64};
14
15use std::{
16    error::Error,
17    fmt,
18    str::{FromStr, from_utf8},
19    sync::atomic::{AtomicU64, Ordering},
20    time::{SystemTime, UNIX_EPOCH},
21};