pub struct MigrationContext {
pub repo_root: PathBuf,
pub project_config_path: PathBuf,
pub global_config_path: Option<PathBuf>,
pub resolved_config: Config,
pub migration_history: MigrationHistory,
}Expand description
Context for migration operations.
Fields§
§repo_root: PathBufRepository root directory.
project_config_path: PathBufPath to project config file.
global_config_path: Option<PathBuf>Path to global config file (if any).
resolved_config: ConfigCurrently resolved configuration.
migration_history: MigrationHistoryLoaded migration history.
Implementations§
Source§impl MigrationContext
impl MigrationContext
Sourcepub fn from_resolved(resolved: &Resolved) -> Result<Self>
pub fn from_resolved(resolved: &Resolved) -> Result<Self>
Create a new migration context from resolved config.
Sourcepub fn is_migration_applied(&self, migration_id: &str) -> bool
pub fn is_migration_applied(&self, migration_id: &str) -> bool
Check if a migration has already been applied.
Sourcepub fn file_exists(&self, path: &str) -> bool
pub fn file_exists(&self, path: &str) -> bool
Check if a file exists relative to repo root.
Sourcepub fn resolve_path(&self, path: &str) -> PathBuf
pub fn resolve_path(&self, path: &str) -> PathBuf
Get full path for a repo-relative path.
Trait Implementations§
Source§impl Clone for MigrationContext
impl Clone for MigrationContext
Source§fn clone(&self) -> MigrationContext
fn clone(&self) -> MigrationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MigrationContext
impl RefUnwindSafe for MigrationContext
impl Send for MigrationContext
impl Sync for MigrationContext
impl Unpin for MigrationContext
impl UnsafeUnpin for MigrationContext
impl UnwindSafe for MigrationContext
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