pub enum SearchPath {
Platform,
Home(&'static str),
Cwd,
Path(PathBuf),
Ancestors(Boundary),
}Expand description
Where to search for config files.
Each variant represents a source of candidate directories. The builder
accepts a Vec<SearchPath> in priority-ascending order: last = highest
priority.
Most variants resolve to a single directory. Ancestors
expands into multiple directories by walking up from the current working
directory. See the module documentation for details.
Variants§
Platform
Platform config directory (XDG on Linux, ~/Library/Application Support on macOS).
Home(&'static str)
A subdirectory under the user’s home directory, e.g. Home(".myapp").
Cwd
Current working directory.
Path(PathBuf)
An explicit absolute path.
Ancestors(Boundary)
Walk up from the current working directory, checking each ancestor.
Expands inline into multiple directories during resolution, ordered from shallowest (filesystem root) to deepest (CWD). This means CWD has the highest priority — a config found closer to the working directory wins.
The Boundary controls where the walk stops.
§Note
This variant is not valid as a persist_scope
path because it resolves to multiple directories. Using it there produces an error.
Trait Implementations§
Source§impl Clone for SearchPath
impl Clone for SearchPath
Source§fn clone(&self) -> SearchPath
fn clone(&self) -> SearchPath
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchPath
impl Debug for SearchPath
Source§impl PartialEq for SearchPath
impl PartialEq for SearchPath
Source§fn eq(&self, other: &SearchPath) -> bool
fn eq(&self, other: &SearchPath) -> bool
self and other values to be equal, and is used by ==.