pub struct Migrator<S> { /* private fields */ }
Expand description
Migrator is used to apply database migrations.
Implementations§
Source§impl<S: Schema> Migrator<S>
impl<S: Schema> Migrator<S>
Sourcepub fn migrate<'a, F, M, N: Schema>(
self,
t: &'a mut ThreadToken,
f: F,
) -> Migrator<N>where
F: FnOnce(&'a Transaction<'a, S>) -> M,
M: Migration<'a, From = S, To = N>,
pub fn migrate<'a, F, M, N: Schema>(
self,
t: &'a mut ThreadToken,
f: F,
) -> Migrator<N>where
F: FnOnce(&'a Transaction<'a, S>) -> M,
M: Migration<'a, From = S, To = N>,
Apply a database migration if the current schema is S
.
The result is a migrator for the next schema N
.
This function will panic if the resulting schema is different, but the version matches.
Auto Trait Implementations§
impl<S> !Freeze for Migrator<S>
impl<S> !RefUnwindSafe for Migrator<S>
impl<S> !Send for Migrator<S>
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