pub struct Migrator;
Implementations
sourceimpl Migrator
impl Migrator
sourcepub 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>>,
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>>,
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.
sourcepub 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>>,
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>>,
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.
sourcepub fn easy_migrate_lmdb_to_safe_mode<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<SafeModeEnvironment>>,
pub fn easy_migrate_lmdb_to_safe_mode<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<SafeModeEnvironment>>,
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.
sourcepub 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>>,
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>>,
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.
sourcepub 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>>,
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>>,
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.
sourcepub fn easy_migrate_safe_mode_to_lmdb<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<LmdbEnvironment>>,
pub fn easy_migrate_safe_mode_to_lmdb<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<LmdbEnvironment>>,
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
impl RefUnwindSafe for Migrator
impl Send for Migrator
impl Sync for Migrator
impl Unpin for Migrator
impl UnwindSafe for Migrator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more