pub struct Migrations { /* private fields */ }Expand description
Collection of database migrations.
Implementations§
Source§impl Migrations
impl Migrations
Sourcepub fn add_migration(&mut self, migration: Arc<dyn Migration>)
pub fn add_migration(&mut self, migration: Arc<dyn Migration>)
Adds a migration to the collection.
Sourcepub fn check(&self, db: &ReadOnlyDB, include_background: bool) -> Ordering
pub fn check(&self, db: &ReadOnlyDB, include_background: bool) -> Ordering
Check if database’s version is matched with the executable binary version.
Returns
- Less: The database version is less than the matched version of the executable binary. Requires migration.
- Equal: The database version is matched with the executable binary version.
- Greater: The database version is greater than the matched version of the executable binary. Requires upgrade the executable binary.
Sourcepub fn expensive(&self, db: &ReadOnlyDB, include_background: bool) -> bool
pub fn expensive(&self, db: &ReadOnlyDB, include_background: bool) -> bool
Check if the migrations will consume a lot of time.
Sourcepub fn can_run_in_background(&self, db: &ReadOnlyDB) -> bool
pub fn can_run_in_background(&self, db: &ReadOnlyDB) -> bool
Check if all the pending migrations will be executed in background.
Trait Implementations§
Source§impl Default for Migrations
impl Default for Migrations
Source§fn default() -> Migrations
fn default() -> Migrations
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Migrations
impl !RefUnwindSafe for Migrations
impl Send for Migrations
impl Sync for Migrations
impl Unpin for Migrations
impl !UnwindSafe for Migrations
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more