pub enum IdError {
HostOutOfRange {
host: u64,
max: u64,
},
NodeOutOfRange {
node_id: u64,
max: u64,
},
MachineIdOutOfRange {
machine_id: u64,
max: u64,
},
TimestampOverflow {
timestamp: u64,
max: u64,
},
SequenceOverflow {
sequence: u64,
max: u64,
},
ClockMovedBackwards {
last_timestamp: u64,
current_timestamp: u64,
skew_millis: u64,
max_skew_millis: u64,
},
TimeBeforeEpoch,
StartTimeAhead,
InvalidBitLength {
name: &'static str,
bits: u8,
reason: &'static str,
},
InvalidTimeUnit {
nanos: u128,
min_nanos: u128,
},
RandomSourceUnavailable,
StatePoisoned,
}Expand description
Error returned when an ID generator cannot create or compose an ID.
Variants§
HostOutOfRange
A Qubit snowflake host identifier is outside its bit range.
NodeOutOfRange
A classic snowflake node identifier is outside its bit range.
MachineIdOutOfRange
A Sonyflake machine identifier is outside its bit range.
TimestampOverflow
A timestamp or elapsed time is too large for the configured bit layout.
Fields
SequenceOverflow
A sequence number is too large for the configured bit layout.
ClockMovedBackwards
The observed clock moved backwards beyond the configured tolerance.
Fields
TimeBeforeEpoch
The requested time is before the configured epoch.
StartTimeAhead
The configured Sonyflake start time is ahead of the generator clock.
InvalidBitLength
A Sonyflake bit length setting is invalid.
Fields
InvalidTimeUnit
A Sonyflake time unit is invalid.
Fields
The operating system random source could not provide random ID bytes.
StatePoisoned
The generator state mutex was poisoned by a panic while locked.
Trait Implementations§
Source§impl Error for IdError
impl Error for IdError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()