Trait home::env::Env

source ·
pub trait Env {
    // Required methods
    fn home_dir(&self) -> Option<PathBuf>;
    fn current_dir(&self) -> Result<PathBuf>;
    fn var_os(&self, key: &str) -> Option<OsString>;
}
Expand description

Permits parameterizing the home functions via the _from variants - used for in-process unit testing by rustup.

Required Methods§

source

fn home_dir(&self) -> Option<PathBuf>

Return the path to the users home dir, or None if any error occurs: see home_inner.

source

fn current_dir(&self) -> Result<PathBuf>

Return the current working directory.

source

fn var_os(&self, key: &str) -> Option<OsString>

Get an environment variable, as per std::env::var_os.

Implementors§