Skip to main content

Migration

Trait Migration 

Source
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§

Source

fn from_version(&self) -> u32

Source

fn to_version(&self) -> u32

Source

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".

Implementors§