pub struct Migrator<'t, 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<'t, S: Schema> Migrator<'t, S>
impl<'t, S: Schema> Migrator<'t, S>
Sourcepub fn migrate<M, N: Schema>(self, m: M) -> Migrator<'t, N>where
M: Migration<'t, From = S, To = N>,
pub fn migrate<M, N: Schema>(self, m: M) -> Migrator<'t, N>where
M: Migration<'t, From = S, To = N>,
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<'t, S> !Freeze for Migrator<'t, S>
impl<'t, S> !RefUnwindSafe for Migrator<'t, S>
impl<'t, S> !Send for Migrator<'t, S>
impl<'t, S> !Sync for Migrator<'t, S>
impl<'t, S> Unpin for Migrator<'t, S>where
S: Unpin,
impl<'t, S> !UnwindSafe for Migrator<'t, 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