pub struct ConfigPaths { /* private fields */ }Expand description
The resolved location of every file the CLI owns.
Implementations§
Source§impl ConfigPaths
impl ConfigPaths
Sourcepub fn resolve_from(explicit: Option<PathBuf>) -> Result<Self>
pub fn resolve_from(explicit: Option<PathBuf>) -> Result<Self>
Resolve from an explicit override, falling back to the environment.
Sourcepub fn resolve_with(
env: &PathEnv,
populated: &dyn Fn(&Path) -> bool,
) -> Result<Self>
pub fn resolve_with( env: &PathEnv, populated: &dyn Fn(&Path) -> bool, ) -> Result<Self>
The resolution rules. populated is the only contact with the filesystem,
so tests can supply their own.
Sourcepub fn for_dir(dir: impl Into<PathBuf>) -> Self
pub fn for_dir(dir: impl Into<PathBuf>) -> Self
Use this directory as-is. For tests and embedding.
Sourcepub fn with_config_file_override(self, file: Option<PathBuf>) -> Self
pub fn with_config_file_override(self, file: Option<PathBuf>) -> Self
Point the config file somewhere else. Affects config_file only: the
credentials stay in the resolved directory.
pub fn dir(&self) -> &Path
pub fn preferred(&self) -> &Path
pub fn source(&self) -> ConfigDirSource
pub fn config_file(&self) -> PathBuf
pub fn credentials_file(&self) -> PathBuf
pub fn encrypted_file(&self) -> PathBuf
Trait Implementations§
Source§impl Clone for ConfigPaths
impl Clone for ConfigPaths
Auto Trait Implementations§
impl Forget for ConfigPaths
impl Freeze for ConfigPaths
impl Move for ConfigPaths
impl RefUnwindSafe for ConfigPaths
impl Send for ConfigPaths
impl Sync for ConfigPaths
impl Unpin for ConfigPaths
impl UnsafeUnpin 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