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§
Sourceasync fn generate_batch(&self, count: usize) -> Vec<String>
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.