Struct migrate_state_file::FileStateLock[][src]

pub struct FileStateLock { /* fields omitted */ }
Expand description

Implements StateLock storing migration state in a file on the local file system. It uses operating system advisory file locks to support state locking.

Pass the file path in FileStateLock::new() method. Default conventional file name is migration-state. Beware that the format of this file is private, so you shouldn’t make any assumptions about it being json, yaml, toml or anything else even UTF-8 encoded.

Example usage:

use migrate_state_file::FileStateLock;
use migrate_core::Plan;

let state_lock = FileStateLock::new("./migration-state");

let plan = Plan::builder(state_lock);

Implementations

Creates migration state file storage. Accepts the file path to migration state file.

If the file at the given path doesn’t exist, then state is considered uninitialized and a new file will be created once it is updated with new state info.

The default conventional name of the file is migration-state

See FileStateLock struct docs for more details

Trait Implementations

General concept Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.