EnvProvider

Trait EnvProvider 

Source
pub trait EnvProvider: Send + Sync {
    // Required method
    fn get(&self, key: &str) -> Option<String>;

    // Provided method
    fn contains(&self, key: &str) -> bool { ... }
}
Expand description

Trait for environment variable access.

This abstraction allows production code to use real environment variables while tests can inject mock values.

Required Methods§

Source

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

Get an environment variable by name.

Provided Methods§

Source

fn contains(&self, key: &str) -> bool

Check if an environment variable is set.

Implementors§