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§
Sourcefn from_version(&self) -> u32
fn from_version(&self) -> u32
The version this step upgrades from (upgrades to from_version + 1).
Sourcefn run(&self, data_dir: &Path) -> Result<(), StorageError>
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.