pub trait Migrate {
// Required methods
fn create_schema_if_not_exists<'e>(
&'e mut self,
schema_name: &'e str,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>;
fn ensure_migrations_table<'e>(
&'e mut self,
table_name: &'e str,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>;
fn dirty_version<'e>(
&'e mut self,
table_name: &'e str,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, MigrateError>> + Send + 'e>>;
fn list_applied_migrations<'e>(
&'e mut self,
table_name: &'e str,
) -> Pin<Box<dyn Future<Output = Result<Vec<AppliedMigration>, MigrateError>> + Send + 'e>>;
fn lock(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + '_>>;
fn unlock(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + '_>>;
fn apply<'e>(
&'e mut self,
table_name: &'e str,
migration: &'e Migration,
) -> Pin<Box<dyn Future<Output = Result<Duration, MigrateError>> + Send + 'e>>;
fn revert<'e>(
&'e mut self,
table_name: &'e str,
migration: &'e Migration,
) -> Pin<Box<dyn Future<Output = Result<Duration, MigrateError>> + Send + 'e>>;
// Provided method
fn skip<'e>(
&'e mut self,
_table_name: &'e str,
_migration: &'e Migration,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>> { ... }
}Available on crate feature
migrate only.Required Methods§
Sourcefn create_schema_if_not_exists<'e>(
&'e mut self,
schema_name: &'e str,
) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>
fn create_schema_if_not_exists<'e>( &'e mut self, schema_name: &'e str, ) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>
Create a database schema with the given name if it does not already exist.
fn ensure_migrations_table<'e>( &'e mut self, table_name: &'e str, ) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>
fn dirty_version<'e>( &'e mut self, table_name: &'e str, ) -> Pin<Box<dyn Future<Output = Result<Option<i64>, MigrateError>> + Send + 'e>>
fn list_applied_migrations<'e>( &'e mut self, table_name: &'e str, ) -> Pin<Box<dyn Future<Output = Result<Vec<AppliedMigration>, MigrateError>> + Send + 'e>>
fn lock( &mut self, ) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + '_>>
fn unlock( &mut self, ) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + '_>>
fn apply<'e>( &'e mut self, table_name: &'e str, migration: &'e Migration, ) -> Pin<Box<dyn Future<Output = Result<Duration, MigrateError>> + Send + 'e>>
fn revert<'e>( &'e mut self, table_name: &'e str, migration: &'e Migration, ) -> Pin<Box<dyn Future<Output = Result<Duration, MigrateError>> + Send + 'e>>
Provided Methods§
fn skip<'e>( &'e mut self, _table_name: &'e str, _migration: &'e Migration, ) -> Pin<Box<dyn Future<Output = Result<(), MigrateError>> + Send + 'e>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".