Skip to main content

Seeder

Trait Seeder 

Source
pub trait Seeder: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn run<'a>(
        &'a self,
        pool: &'a DbPool,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'a>>;
}
Available on crate features model-mysql or model-postgres or model-sqlite only.
Expand description

Rows put in a database by Rust code; see the module docs. Seeders::add makes one from a closure.

Required Methods§

Source

fn name(&self) -> &str

What seed_with and db seed report it as.

Source

fn run<'a>( &'a self, pool: &'a DbPool, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + 'a>>

Put the rows in pool (the primary of a replicated pool).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§