Skip to main content

EnvSource

Trait EnvSource 

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

Read-only access to the process environment.

Required Methods§

Source

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

The value of a single variable, or None if it is unset.

Source

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

Every variable as a (name, value) pair. SystemEnv reads std::env::vars, which panics on a non-Unicode entry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§