Skip to main content

IdGenerator

Trait IdGenerator 

Source
pub trait IdGenerator: Send + Sync {
    // Required methods
    async fn generate(&self) -> String;
    async fn generate_batch(&self, count: usize) -> Vec<String>;
}
Expand description

ID 生成器 trait (dyn 兼容)

Required Methods§

Source

async fn generate(&self) -> String

生成单个 ID

Source

async fn generate_batch(&self, count: usize) -> Vec<String>

批量生成 ID

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.

Implementors§