Struct ckb_db_migration::DefaultMigration

source ·
pub struct DefaultMigration { /* private fields */ }
Expand description

TODO(doc): @quake

Implementations§

source§

impl DefaultMigration

source

pub fn new(version: &str) -> Self

TODO(doc): @quake

Trait Implementations§

source§

impl Migration for DefaultMigration

source§

fn migrate( &self, db: RocksDB, _pb: Arc<dyn Fn(u64) -> ProgressBar + Send + Sync> ) -> Result<RocksDB, Error>

TODO(doc): @quake
source§

fn version(&self) -> &str

returns migration version, use date +'%Y%m%d%H%M%S' timestamp format
source§

fn expensive(&self) -> bool

Will cost a lot of time to perform this migration operation. Read more
source§

fn run_in_background(&self) -> bool

Will this migration be executed in background.
source§

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

Check if the background migration can be resumed. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V