Crate ferroid

Source

Structs§

AtomicSnowflakeGenerator
A lock-free Snowflake ID generator suitable for multi-threaded environments.
BasicSnowflakeGenerator
A non-concurrent Snowflake ID generator suitable for single-threaded environments.
LockSnowflakeGenerator
A lock-based Snowflake ID generator suitable for multi-threaded environments.
MonotonicClock
A monotonic time source that returns elapsed time since process start, offset from a user-defined epoch.
SnowflakeDiscordId
A 64-bit Snowflake ID using the Discord layout
SnowflakeInstagramId
A 64-bit Snowflake ID using the Instagram layout
SnowflakeMastodonId
A 64-bit Snowflake ID using the Mastodon layout
SnowflakeTwitterId
A 64-bit Snowflake ID using the classic Twitter layout

Enums§

Error
IdGenStatus
Represents the result of attempting to generate a new Snowflake ID.

Constants§

CUSTOM_EPOCH
Custom epoch: Wednesday, January 1, 2025 00:00:00 UTC
DISCORD_EPOCH
Discord epoch: Thursday, January 1, 2015 00:00:00 UTC
INSTAGRAM_EPOCH
Instagram epoch: Saturday, January 1, 2011 00:00:00 UTC
MASTODON_EPOCH
Mastodon uses standard UNIX epoch: Thursday, January 1, 1970 00:00:00 UTC
TWITTER_EPOCH
Twitter epoch: Thursday, November 4, 2010 1:42:54.657 UTC

Traits§

Base32
A trait for types that can be encoded to and decoded from base32 (crockford) strings.
BeBytes
A trait for types that can be encoded to and decoded from big-endian bytes.
MultithreadedSnowflakeGenerator
A minimal interface for generating Snowflake IDs in a thread-safe context.
Snowflake
A trait representing a layout-compatible Snowflake ID generator.
SnowflakeGenerator
A minimal interface for generating Snowflake IDs in a single-threaded context.
TimeSource
A trait for time sources that return a monotonic or wall-clock timestamp.

Type Aliases§

Result