pub struct ConfigPaths { /* private fields */ }Expand description
Namespace for resolving configuration directories and filenames.
Implementations§
Source§impl ConfigPaths
impl ConfigPaths
Sourcepub fn with_project_dirs() -> Result<Self, ConfigError>
pub fn with_project_dirs() -> Result<Self, ConfigError>
Create configuration paths using the user’s platform conventions.
Sourcepub fn from_base_dir(base_dir: impl Into<PathBuf>) -> Self
pub fn from_base_dir(base_dir: impl Into<PathBuf>) -> Self
Construct from a custom base directory (primarily for testing).
Sourcepub fn config_file(&self) -> PathBuf
pub fn config_file(&self) -> PathBuf
Location of the persisted configuration file.
Sourcepub fn accounts_dir(&self) -> PathBuf
pub fn accounts_dir(&self) -> PathBuf
Directory that stores account metadata.
Sourcepub fn accounts_file(&self) -> PathBuf
pub fn accounts_file(&self) -> PathBuf
File path storing account metadata index.
Sourcepub fn ensure_exists(&self) -> Result<(), ConfigError>
pub fn ensure_exists(&self) -> Result<(), ConfigError>
Ensure the configuration root exists on disk.
Trait Implementations§
Source§impl Clone for ConfigPaths
impl Clone for ConfigPaths
Source§fn clone(&self) -> ConfigPaths
fn clone(&self) -> ConfigPaths
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 ConfigPaths
impl RefUnwindSafe for ConfigPaths
impl Send for ConfigPaths
impl Sync for ConfigPaths
impl Unpin for ConfigPaths
impl UnwindSafe for ConfigPaths
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