docs.rs failed to build snowflaker-0.3.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
snowflaker-0.3.6
snowflake
A Twitter snowflake algorithm simply implemented in Rust.
1.Usage
Add this to your Cargo.toml:
[]
= "0.3"
# Or
# @see SnowflakeGenerator::dynamic()
= { = "0.3", = ["dynamic"] }
2.APIs
2.1.Generator
2.1.1.builtin
// use the default data-center ID and worker ID
let gen = builtin;
assert!;
2.1.2.new
let gen = new;
assert!;
let gen = new;
assert!;
2.1.3.dynamic
@since 0.2.0
[]
= { = "${version}", = ["dynamic"] }
let gen = dynamic;
assert!;
let rvt = gen.unwrap.next_id;
assert!;
2.2.Functions
2.2.1.next_id
// 122235238222008321
let rvt = next_id;
assert!;
2.2.2.next_id_string
// 122256588529602560
let rvt = next_id_string;
assert!;
2.3.Macros
@since 0.3.0
2.3.1.snowflake_builtin
let rvt = snowflake_builtin!;
assert!;
2.3.2.snowflake_builtin_string
let rvt = snowflake_builtin_string!;
assert!;
2.3.3.snowflake_dynamic
let rvt = snowflake_dynamic!;
assert!;
2.3.4.snowflake_dynamic_string
let rvt = snowflake_dynamic_string!;
assert!;
2.4.Custom
data-centerIDworkerID
let center_id = 16;
let worker_id = 16;
let gen = new;
assert!;
let rvt = gen.unwrap.next_id;
assert!;
3.Test
3.1.cargo test
$ cargo test --features "dynamic" -- --show-output
$ cargo test --features "dynamic"
4.Docs
4.1.features
$ cargo doc --open --features dynamic