snowflake_gen/generator/components.rs
1/// The decoded components of a Snowflake ID.
2///
3/// Obtained via [`crate::generator::SnowflakeIdGenerator::decompose`].
4#[must_use]
5#[derive(Copy, Clone, Debug, PartialEq, Eq)]
6pub struct SnowflakeComponents {
7 /// Milliseconds since the generator's epoch.
8 pub timestamp_millis: i64,
9 /// Machine identifier embedded in the ID.
10 pub machine_id: i64,
11 /// Node identifier embedded in the ID.
12 pub node_id: i64,
13 /// Per-millisecond sequence counter embedded in the ID.
14 pub sequence: u32,
15}