pub struct ConfigFile { /* private fields */ }Expand description
A loaded config file plus the exact source revision it came from.
Saving compares that source with the current file before writing, so an editor or another process cannot be overwritten by a stale GUI snapshot. Existing comments and formatting are retained for keys that still exist.
Implementations§
Source§impl ConfigFile
impl ConfigFile
Sourcepub fn load_or_default() -> Result<(Config, Self), ConfigError>
pub fn load_or_default() -> Result<(Config, Self), ConfigError>
Load the default user config, returning a writable default when the file does not exist yet.
Sourcepub fn load_from_path(path: &Path) -> Result<(Config, Self), ConfigError>
pub fn load_from_path(path: &Path) -> Result<(Config, Self), ConfigError>
Load path, retaining its source revision for conflict-safe saves.
Trait Implementations§
Source§impl Clone for ConfigFile
impl Clone for ConfigFile
Source§fn clone(&self) -> ConfigFile
fn clone(&self) -> ConfigFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ConfigFile
impl RefUnwindSafe for ConfigFile
impl Send for ConfigFile
impl Sync for ConfigFile
impl Unpin for ConfigFile
impl UnsafeUnpin for ConfigFile
impl UnwindSafe for ConfigFile
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