pub struct Migrate { /* private fields */ }Expand description
migrate helper
Implementations§
Source§impl Migrate
impl Migrate
Sourcepub fn open_read_only_db(&self) -> Result<Option<ReadOnlyDB>, Error>
pub fn open_read_only_db(&self) -> Result<Option<ReadOnlyDB>, Error>
Open read only db
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 require_expensive(
&self,
db: &ReadOnlyDB,
include_background: bool,
) -> bool
pub fn require_expensive( &self, db: &ReadOnlyDB, include_background: bool, ) -> bool
Check whether database requires expensive migrations.
Sourcepub fn can_run_in_background(&self, db: &ReadOnlyDB) -> bool
pub fn can_run_in_background(&self, db: &ReadOnlyDB) -> bool
Check whether the pending migrations are all background migrations.
Auto Trait Implementations§
impl Freeze for Migrate
impl !RefUnwindSafe for Migrate
impl Send for Migrate
impl Sync for Migrate
impl Unpin for Migrate
impl !UnwindSafe for Migrate
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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