[][src]Struct rkv::backend::LmdbArchMigrator

pub struct LmdbArchMigrator { /* fields omitted */ }

Implementations

impl Migrator[src]

pub fn new(path: &Path) -> MigrateResult<Migrator>[src]

Create a new Migrator for the LMDB environment at the given path. This tries to open the data.mdb file in the environment and determine the bit depth of the executable that created it, so it can fail and return an Err if the file can't be opened or the depth determined.

pub fn dump<T: Write>(
    &mut self,
    database: Option<&str>,
    out: T
) -> MigrateResult<()>
[src]

Dump the data in one of the databases in the LMDB environment. If the database paremeter is None, then we dump the data in the main database. If it's the name of a subdatabase, then we dump the data in that subdatabase.

Note that the output isn't identical to that of the mdb_dump utility, since mdb_dump includes subdatabase key/value pairs when dumping the main database, and those values are architecture-dependent, since they contain pointer-sized data.

If we wanted to support identical output, we could parameterize inclusion of subdatabase pairs in get_pairs() and include them when dumping data, while continuing to exclude them when migrating data.

pub fn migrate(&mut self, dest: &Path) -> MigrateResult<()>[src]

Migrate all data in all of databases in the existing LMDB environment to a new 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.

We also set the map size and maximum databases of the new environment to their values for the existing environment. But we don't set other metadata, and we don't check that the new environment is empty before migrating data.

Thus it's possible for this to overwrite existing data or fail to migrate data if the new environment isn't empty. It's the consumer's responsibility to ensure that data can be safely migrated to the new environment. In general, this means that environment should be empty.

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.