pub struct MigrationChain { /* private fields */ }Expand description
A sequence of Migration steps applied in version order.
Implementations§
Source§impl MigrationChain
impl MigrationChain
pub fn with_step(self, step: impl Migration + 'static) -> Self
Sourcepub fn run(
&self,
value: ConfigValue,
current_version: u32,
target_version: u32,
) -> Result<ConfigValue, MigrationError>
pub fn run( &self, value: ConfigValue, current_version: u32, target_version: u32, ) -> Result<ConfigValue, MigrationError>
Run migrations from current_version up to target_version.
§Errors
Returns MigrationError::NoPath if no step covers the current version,
or MigrationError::Step if a step’s transformation fails.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MigrationChain
impl !UnwindSafe for MigrationChain
impl Freeze for MigrationChain
impl Send for MigrationChain
impl Sync for MigrationChain
impl Unpin for MigrationChain
impl UnsafeUnpin for MigrationChain
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more