Skip to main content

load_env_file

Function load_env_file 

Source
pub fn load_env_file<T: DeserializeOwned>(
    env_path: impl AsRef<Path>,
    prefix: &str,
) -> Result<T, FaucetError>
Expand description

Load a .env file into the process environment, then deserialize a config struct from environment variables with a prefix.

This combines dotenvy (for .env file loading) with envy (for struct deserialization from env vars).

The .env file is loaded first, setting any variables that aren’t already set in the environment. Then load_env is called.