Skip to main content

Environment

Trait Environment 

Source
pub trait Environment: Send + Sync {
    // Required methods
    fn var(&self, key: &str) -> Option<String>;
    fn vars(&self) -> HashMap<String, String>;
}
Expand description

Trait for environment variable access, allowing testability.

Required Methods§

Source

fn var(&self, key: &str) -> Option<String>

Get an environment variable.

Source

fn vars(&self) -> HashMap<String, String>

Get all environment variables.

Implementors§