atomic-snowflake 11.1.0

Zero-dependency lock-free monotonic 64-bit Snowflake ID, 128-bit ULID, and RFC 9562 UUIDv7 generators with stack-buffered Crockford Base32 and hyphenated hex codecs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// Error type returned by Snowflake, ULID, and UUIDv7 constructors and parsers.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum IdError {
    /// Node ID exceeded the 10-bit Snowflake limit (`0..=1023`).
    NodeIdOutOfRange,
    /// ULID input length was not 26 bytes.
    InvalidUlidLength,
    /// ULID input contained a character outside Crockford Base32.
    InvalidUlidCharacter,
    /// ULID first character exceeded `'7'`, overflowing 128 bits.
    UlidOverflow,
    /// UUID input did not match 32-hex or 36-char hyphenated format.
    InvalidUuidFormat,
    /// Snowflake text representation failed to parse as a 64-bit unsigned integer.
    InvalidSnowflakeString,
}