Struct ckb_db_migration::DefaultMigration
source · pub struct DefaultMigration { /* private fields */ }
Expand description
TODO(doc): @quake
Implementations§
Trait Implementations§
source§impl Migration for DefaultMigration
impl Migration for DefaultMigration
source§fn migrate(
&self,
db: RocksDB,
_pb: Arc<dyn Fn(u64) -> ProgressBar + Send + Sync>
) -> Result<RocksDB, Error>
fn migrate( &self, db: RocksDB, _pb: Arc<dyn Fn(u64) -> ProgressBar + Send + Sync> ) -> Result<RocksDB, Error>
TODO(doc): @quake
source§fn version(&self) -> &str
fn version(&self) -> &str
returns migration version, use
date +'%Y%m%d%H%M%S'
timestamp formatsource§fn expensive(&self) -> bool
fn expensive(&self) -> bool
Will cost a lot of time to perform this migration operation. Read more
source§fn run_in_background(&self) -> bool
fn run_in_background(&self) -> bool
Will this migration be executed in background.
source§fn stop_background(&self) -> bool
fn stop_background(&self) -> bool
Check if the background migration should be stopped.
If a migration need to implement the recovery logic, it should check this flag periodically,
store the migration progress when exiting and recover from the current progress when restarting.
source§fn can_resume(&self) -> bool
fn can_resume(&self) -> bool
Check if the background migration can be resumed. Read more
Auto Trait Implementations§
impl Freeze for DefaultMigration
impl RefUnwindSafe for DefaultMigration
impl Send for DefaultMigration
impl Sync for DefaultMigration
impl Unpin for DefaultMigration
impl UnwindSafe for DefaultMigration
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