pub struct Migrator<S> { /* private fields */ }Expand description
Migrator is used to apply database migrations.
When all migrations are done, it can be turned into a Database instance with Migrator::finish.
Implementations§
Source§impl<S: Schema> Migrator<S>
impl<S: Schema> Migrator<S>
Sourcepub fn migrate<'x, M>(
self,
m: impl Send + FnOnce(&mut TransactionMigrate<S>) -> M,
) -> Migrator<M::To>where
M: SchemaMigration<'x, From = S>,
pub fn migrate<'x, M>(
self,
m: impl Send + FnOnce(&mut TransactionMigrate<S>) -> M,
) -> Migrator<M::To>where
M: SchemaMigration<'x, From = S>,
Apply a database migration if the current schema is S and return a Migrator for the next schema N.
This function will panic if the schema on disk does not match what is expected for its user_version.
Auto Trait Implementations§
impl<S> !Freeze for Migrator<S>
impl<S> !RefUnwindSafe for Migrator<S>
impl<S> Send for Migrator<S>where
S: Send,
impl<S> !Sync for Migrator<S>
impl<S> Unpin for Migrator<S>where
S: Unpin,
impl<S> !UnwindSafe for Migrator<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more