pub trait EnvSource {
// Required method
fn var_os(&self, key: &str) -> Option<OsString>;
// Provided methods
fn path_exists(&self, path: &Path) -> bool { ... }
fn temp_dir(&self) -> PathBuf { ... }
fn current_dir(&self) -> Result<PathBuf> { ... }
}Expand description
Environment and filesystem inputs used by a directory resolver.
Override the filesystem methods as well as var_os for fully isolated tests.
No resolver mutates the process environment.
Required Methods§
Provided Methods§
Sourcefn path_exists(&self, path: &Path) -> bool
fn path_exists(&self, path: &Path) -> bool
Whether path exists. The resolver uses it to tell an existing
installation’s data directory from one that has never been created.
Sourcefn temp_dir(&self) -> PathBuf
fn temp_dir(&self) -> PathBuf
The system temporary directory. It holds the last fallback location of
the daemon’s connection file (see Dirs::connection_file_candidates).
Sourcefn current_dir(&self) -> Result<PathBuf>
fn current_dir(&self) -> Result<PathBuf>
The process’s current directory, which a relative path given explicitly
by the user (for example a --subc ./conn.json argument) is joined to.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".