Skip to main content

RestoreMode

Enum RestoreMode 

Source
#[repr(i32)]
pub enum RestoreMode { KKeepLatestDbSessionIdFiles = 1, KVerifyChecksum = 2, KPurgeAllFiles = 65_535, }
Expand description

How much of the destination database a restore may reuse.

Mirrors RestoreOptions::Mode in include/rocksdb/utilities/backup_engine.h. The values look like flags but RocksDB only ever compares the field for equality, so the modes are exclusive and must not be combined.

Variants§

§

KKeepLatestDbSessionIdFiles = 1

Cheapest way to restore a healthy database. Files whose names already encode the DB session id are kept, so an interrupted or partial copy can be completed instead of recopied. This mode also cooperates with CreateBackupOptions::set_exclude_files_callback by looking for excluded files in the existing database directory.

Only effective for files using a modern share files naming scheme, see ShareFilesNaming.

§

KVerifyChecksum = 2

For a database suspected to be corrupt. Each existing file is checksummed against the checksum recorded in the backup metadata, and only files that fail the comparison are replaced.

§

KPurgeAllFiles = 65_535

Zero trust and least efficient. Deletes every file in the destination and copies everything from the backup. This is the default.

Trait Implementations§

Source§

impl Clone for RestoreMode

Source§

fn clone(&self) -> RestoreMode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RestoreMode

Source§

impl Debug for RestoreMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RestoreMode

Source§

impl From<i32> for RestoreMode

Source§

fn from(value: i32) -> Self

Values RocksDB does not define map to RestoreMode::KPurgeAllFiles, the upstream default and the only mode that makes no assumptions about the destination directory.

Source§

impl PartialEq for RestoreMode

Source§

fn eq(&self, other: &RestoreMode) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RestoreMode

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.