pub trait MultithreadedSnowflakeGenerator<ID: Snowflake> {
// Required methods
fn next(&self) -> IdGenStatus<ID>;
fn try_next(&self) -> Result<IdGenStatus<ID>>;
}Expand description
A minimal interface for generating Snowflake IDs in a thread-safe context.
This trait is primarily used for benchmarking and testing different generator implementations. It abstracts over common generator methods without exposing implementation details.
§Note
This trait is not intended for external use and may change or be removed in future versions.
Required Methods§
Sourcefn next(&self) -> IdGenStatus<ID>
fn next(&self) -> IdGenStatus<ID>
Returns the next available ID or yields if generation is temporarily stalled.
Sourcefn try_next(&self) -> Result<IdGenStatus<ID>>
fn try_next(&self) -> Result<IdGenStatus<ID>>
A fallible version of Self::next that returns a Result.