Skip to main content

MigrationBackend

Trait MigrationBackend 

Source
pub trait MigrationBackend: Send + Sync {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn apply<'life0, 'life1, 'async_trait>(
        &'life0 self,
        migrations: &'life1 [PreparedMigration],
    ) -> Pin<Box<dyn Future<Output = Result<MigrationReport, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Applies an already validated migration set.

Implementations must serialize concurrent migrators, verify previously applied checksums, and atomically record every migration they apply.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Required Methods§

Source

fn apply<'life0, 'life1, 'async_trait>( &'life0 self, migrations: &'life1 [PreparedMigration], ) -> Pin<Box<dyn Future<Output = Result<MigrationReport, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§