Trait EnvConfig

Source
pub trait EnvConfig<T = HashMap<String, String>>: AbstractConfig<T> {
    // Provided method
    fn load(target: Option<String>) -> Result<T, Error>
       where T: Default,
             HashMap<String, String>: Into<T>,
             Self: Sized { ... }
}
Expand description

Indicates that structure can be initialize from environment variables.

Provided Methods§

Source

fn load(target: Option<String>) -> Result<T, Error>
where T: Default, HashMap<String, String>: Into<T>, Self: Sized,

Load specified env files to environment variables and initialize the structure.

§Arguments
  • target - A comma-separated string of env file paths, e.g., “.env,.env.local”.
§Errors
  • Error::LoadFileError - If any of the specified env files cannot be loaded.

Implementors§