pub struct RepoConfigManager { /* private fields */ }Implementations§
Source§impl RepoConfigManager
impl RepoConfigManager
pub fn new(repo_root: PathBuf) -> Self
Sourcepub fn load(&self) -> Result<Option<RepoConfig>>
pub fn load(&self) -> Result<Option<RepoConfig>>
Load v1 configuration. Prefer using load_desired_state() or ensure_v2_default() for new code.
Sourcepub fn save(&self, config: &RepoConfig) -> Result<()>
pub fn save(&self, config: &RepoConfig) -> Result<()>
Save v1 configuration. Prefer using save_v2_validated() for new code.
Sourcepub fn ensure_default(&self) -> Result<RepoConfig>
pub fn ensure_default(&self) -> Result<RepoConfig>
Ensure v1 default configuration. Prefer using ensure_v2_default() for new code.
pub fn load_desired_state(&self) -> Result<Option<DesiredState>>
pub fn add_mount(&mut self, mount: RequiredMount) -> Result<()>
pub fn remove_mount(&mut self, mount_path: &str) -> Result<bool>
Sourcepub fn load_v2_or_bail(&self) -> Result<RepoConfigV2>
pub fn load_v2_or_bail(&self) -> Result<RepoConfigV2>
Load v2 config or error if it doesn’t exist
Sourcepub fn save_v2(&self, config: &RepoConfigV2) -> Result<()>
pub fn save_v2(&self, config: &RepoConfigV2) -> Result<()>
Save v2 configuration
Sourcepub fn ensure_v2_default(&self) -> Result<RepoConfigV2>
pub fn ensure_v2_default(&self) -> Result<RepoConfigV2>
Ensure v2 config exists, create default if not
Sourcepub fn validate_v2_soft(&self, cfg: &RepoConfigV2) -> Vec<String>
pub fn validate_v2_soft(&self, cfg: &RepoConfigV2) -> Vec<String>
Soft validation for v2 configuration returning warnings only
Sourcepub fn peek_config_version(&self) -> Result<Option<String>>
pub fn peek_config_version(&self) -> Result<Option<String>>
Peek the on-disk config version without fully parsing
Sourcepub fn validate_v2_hard(&self, cfg: &RepoConfigV2) -> Result<Vec<String>>
pub fn validate_v2_hard(&self, cfg: &RepoConfigV2) -> Result<Vec<String>>
Hard validator for v2 config. Returns warnings (non-fatal).
Sourcepub fn save_v2_validated(&self, config: &RepoConfigV2) -> Result<Vec<String>>
pub fn save_v2_validated(&self, config: &RepoConfigV2) -> Result<Vec<String>>
Save v2 configuration with hard validation. Returns warnings (non-fatal).
Auto Trait Implementations§
impl Freeze for RepoConfigManager
impl RefUnwindSafe for RepoConfigManager
impl Send for RepoConfigManager
impl Sync for RepoConfigManager
impl Unpin for RepoConfigManager
impl UnwindSafe for RepoConfigManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more