[][src]Struct rkv::migrator::Migrator

pub struct Migrator;

Implementations

impl Migrator[src]

pub fn migrate_lmdb_to_safe_mode<S, D>(
    src_env: S,
    dst_env: D
) -> Result<(), MigrateError> where
    S: Deref<Target = Rkv<LmdbEnvironment>>,
    D: Deref<Target = Rkv<SafeModeEnvironment>>, 
[src]

Migrate all data in all of databases from the source environment to the destination environment. This includes all key/value pairs in the main database that aren't metadata about subdatabases and all key/value pairs in all subdatabases.

Other backend-specific metadata such as map size or maximum databases left intact on the given environments.

The destination environment should be empty of data, otherwise an error is returned.

pub fn open_and_migrate_lmdb_to_safe_mode<F, D>(
    path: &Path,
    build: F,
    dst_env: D
) -> Result<(), MigrateError> where
    F: FnOnce(Lmdb) -> Lmdb,
    D: Deref<Target = Rkv<SafeModeEnvironment>>, 
[src]

Same as the the migrate_x_to_y migration method above, but automatically attempts to open the source environment. Finally, deletes all of its supporting files if there's no other environment open at that path and the migration succeeded.

pub fn easy_migrate_lmdb_to_safe_mode<D>(
    path: &Path,
    dst_env: D
) -> Result<(), MigrateError> where
    D: Deref<Target = Rkv<SafeModeEnvironment>>, 
[src]

Same as the open_and_migrate_x_to_y migration method above, but ignores the migration and doesn't delete any files if the following conditions apply:

  • Source environment is invalid (corrupted), unavailable, or empty.
  • Destination environment is not empty. Use this instead of the other migration methods if:
  • You're not concerned by throwing away old data and starting fresh with a new store.
  • You'll never want to overwrite data in the new store from the old store.

pub fn migrate_safe_mode_to_lmdb<S, D>(
    src_env: S,
    dst_env: D
) -> Result<(), MigrateError> where
    S: Deref<Target = Rkv<SafeModeEnvironment>>,
    D: Deref<Target = Rkv<LmdbEnvironment>>, 
[src]

Migrate all data in all of databases from the source environment to the destination environment. This includes all key/value pairs in the main database that aren't metadata about subdatabases and all key/value pairs in all subdatabases.

Other backend-specific metadata such as map size or maximum databases left intact on the given environments.

The destination environment should be empty of data, otherwise an error is returned.

pub fn open_and_migrate_safe_mode_to_lmdb<F, D>(
    path: &Path,
    build: F,
    dst_env: D
) -> Result<(), MigrateError> where
    F: FnOnce(SafeMode) -> SafeMode,
    D: Deref<Target = Rkv<LmdbEnvironment>>, 
[src]

Same as the the migrate_x_to_y migration method above, but automatically attempts to open the source environment. Finally, deletes all of its supporting files if there's no other environment open at that path and the migration succeeded.

pub fn easy_migrate_safe_mode_to_lmdb<D>(
    path: &Path,
    dst_env: D
) -> Result<(), MigrateError> where
    D: Deref<Target = Rkv<LmdbEnvironment>>, 
[src]

Same as the open_and_migrate_x_to_y migration method above, but ignores the migration and doesn't delete any files if the following conditions apply:

  • Source environment is invalid (corrupted), unavailable, or empty.
  • Destination environment is not empty. Use this instead of the other migration methods if:
  • You're not concerned by throwing away old data and starting fresh with a new store.
  • You'll never want to overwrite data in the new store from the old store.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.