idworker 1.1.0

A high-performance distributed ID generator library implementing Snowflake algorithm variants with multiple optimization modes for different performance requirements.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::time::SystemTimeError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum IdWorkerError {
    #[error("配置错误: {0}")]
    Config(String),
    #[error("Fail to set ID_WORKER")]
    SetIdWorker(),
    #[error("Fail to get ID_WORKER")]
    GetIdWorker(),
    #[error("系统时钟错误: {0}")]
    SystemTime(#[from] SystemTimeError),
}