Skip to main content

MigrationStep

Trait MigrationStep 

Source
pub trait MigrationStep: Send + Sync {
    // Required methods
    fn from_version(&self) -> u32;
    fn run(&self, data_dir: &Path) -> Result<(), StorageError>;
}
Expand description

A single migration step from from_version to from_version + 1.

Required Methods§

Source

fn from_version(&self) -> u32

The version this step upgrades from (upgrades to from_version + 1).

Source

fn run(&self, data_dir: &Path) -> Result<(), StorageError>

Apply the migration. data_dir is the directory containing the data to be migrated.

§Errors

Returns StorageError::Migration or other storage errors on failure.

Implementors§