1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! # TypedFlake
//!
//! Distributed, type-safe Snowflake ID generation for Rust.
//!
//! Generate unique, time-ordered 64-bit IDs across distributed systems without coordination.
//! Each ID type is a distinct newtype that cannot be mixed with others at compile time.
//!
//! ## Quick Start
//!
//! ```rust
//! typedflake::id!(UserId);
//!
//! fn example() {
//! let id = UserId::generate();
//! let (timestamp, worker_id, process_id, sequence) = id.decompose();
//! }
//! ```
//!
//! ## Main Types
//!
//! - [`Config`] - Complete configuration (bit layout + epoch)
//! - [`BitLayout`] - Bit allocation for the 64-bit ID space
//! - [`Epoch`] - Custom epoch timestamps
//!
//! Use the [`id!`](crate::id) macro to create new ID types with their own independent state.
// Keep macros private, they're exported via the macro itself
// Re-export paste macro for use in the id! macro expansion (macro hygiene)
pub use paste as __paste;
// Re-export serde when feature is enabled (macro hygiene for conditional trait impls)
pub use serde as __serde;
// Re-export main types and the macro
pub use ;
pub use IdContext;
pub use ;