Crate idgenerator
source · [−]Expand description
idgenerator
A powerful unique id generator.
Out-of-the-box instances
This lib has provided two out-of-the-box implementations:
IdInstance
: a instance with only one generator. See examples/single.rs for usage example.IdVecInstance
: a instance with multiple generators. See examples/multiple.rs for usage example.
Self-implement instance
This lib wraps the snowflake algorithm inside the CoreIdGenerator
struct.
You can wrap this struct inside your own instance of unique id generator.
Others
IdGeneratorOptions
: options for id generator.OptionError
: errors for setting options.
Re-exports
pub use error::OptionError;
pub use generator::CoreIdGenerator;
pub use instance::IdInstance;
pub use instance::IdVecInstance;
pub use options::IdGeneratorOptions;