Skip to main content

atomic_snowflake/error/
enum.rs

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