pub trait DatabaseSeeder: Send + Sync {
// Required methods
fn seed<'life0, 'async_trait>(
&'life0 self,
txn: Arc<DatabaseTransaction>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
txn: Arc<DatabaseTransaction>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn name(&self) -> &str { ... }
fn order(&self) -> i32 { ... }
}Expand description
Trait for database seeders.
Implementations receive an Arc<DatabaseTransaction> so all work runs
inside the runner’s single transaction while the handle stays freely
shareable (e.g., for nested repository calls via RepositoryOptions).
Do not retain clones beyond the call: committing requires sole ownership.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".