pub struct MigrationRunner { /* private fields */ }Implementations§
Source§impl MigrationRunner
impl MigrationRunner
Sourcepub fn new(migrations: Vec<Migration>) -> Self
pub fn new(migrations: Vec<Migration>) -> Self
Migrations must already be in strictly increasing version order – panics otherwise, loud and at boot time rather than a silently skipped migration later.
Sourcepub fn run(self, conn: &mut Connection) -> Result<()>
pub fn run(self, conn: &mut Connection) -> Result<()>
Applies every pending migration inside one BEGIN EXCLUSIVE
transaction, tracked in schema_migrations(version, label, applied_at) – the exact table name and shape the previous
dependency used, so an already-migrated mail4agent.sqlite opens
with every version already recorded and nothing re-applied.
busy_timeout is bumped to 30s for the duration of the exclusive
lock so a second instance starting concurrently waits rather than
failing outright, then restored to whatever it was before.
Auto Trait Implementations§
impl Freeze for MigrationRunner
impl RefUnwindSafe for MigrationRunner
impl Send for MigrationRunner
impl Sync for MigrationRunner
impl Unpin for MigrationRunner
impl UnsafeUnpin for MigrationRunner
impl UnwindSafe for MigrationRunner
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