pub trait SnowflakeGeneratorAsyncTokioExt<ID, T>{
// Required method
fn try_next_id_async(&self) -> impl Future<Output = Result<ID>>;
}Expand description
Extension trait for asynchronously generating Snowflake IDs using the
tokio async runtime.
This trait provides a convenience method for using a SleepProvider
backed by the tokio runtime, allowing you to call .try_next_id_async()
without specifying the sleep strategy manually.
Required Methods§
Sourcefn try_next_id_async(&self) -> impl Future<Output = Result<ID>>
fn try_next_id_async(&self) -> impl Future<Output = Result<ID>>
Returns a future that resolves to the next available Snowflake ID using
the TokioSleep provider.
Internally delegates to
SnowflakeGeneratorAsyncExt::try_next_id_async method with
TokioSleep as the sleep strategy.
§Errors
This future may return an error if the underlying generator does.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.