[−][src]Struct rkv::migrator::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]
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.
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]
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.
pub fn easy_migrate_lmdb_to_safe_mode<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<SafeModeEnvironment>>,
[src]
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.
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]
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.
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]
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.
pub fn easy_migrate_safe_mode_to_lmdb<D>(
path: &Path,
dst_env: D
) -> Result<(), MigrateError> where
D: Deref<Target = Rkv<LmdbEnvironment>>,
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,