home::env

Trait 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 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§