trait Env {
// Required method
fn get(&self, name: &'static str) -> Result<String, VarError>;
}Expand description
A thin wrapper around env::Vars to allows dummy implementations for unit
testing. Code that deals with env::Vars is often hard to test, since
altering env vars in a test may affect other tests that are running
concurrently. This trait can easily be implemented for
a std::collections::HashMap, thus keeping updates locally.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".