pub trait Env:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn var(&self, key: &str) -> Option<String>;
fn vars(&self) -> HashMap<String, String>;
fn home_dir(&self) -> Option<PathBuf>;
}Expand description
Permits parameterizing the home functions via the _from variants
Required Methods§
Sourcefn var(&self, key: &str) -> Option<String>
fn var(&self, key: &str) -> Option<String>
Get an environment variable.
- Returns
Some(v)if the environment variable is found and is valid utf-8. - Returns
Noneif the environment variable is not found or value is invalid.