pub trait Migration: Send + Sync {
// Required methods
fn from_version(&self) -> u32;
fn to_version(&self) -> u32;
fn migrate(&self, value: ConfigValue) -> Result<ConfigValue, MigrationError>;
}Expand description
A single schema migration step.
Required Methods§
fn from_version(&self) -> u32
fn to_version(&self) -> u32
Sourcefn migrate(&self, value: ConfigValue) -> Result<ConfigValue, MigrationError>
fn migrate(&self, value: ConfigValue) -> Result<ConfigValue, MigrationError>
Transform value from from_version to to_version.
§Errors
Returns MigrationError::Step if the transformation fails.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".