AsyncMigratesTo

Trait AsyncMigratesTo 

Source
pub trait AsyncMigratesTo<T: Versioned>: Versioned + Send {
    // Required method
    fn migrate<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<T, MigrationError>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

Async version of MigratesTo for migrations requiring I/O operations.

Use this trait when migrations need to perform asynchronous operations such as database queries or API calls.

Required Methods§

Source

fn migrate<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<T, MigrationError>> + Send + 'async_trait>>
where Self: 'async_trait,

Asynchronously migrates from the current version to the target version.

§Errors

Returns MigrationError if the migration fails.

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§