Skip to main content

from_env

Function from_env 

Source
pub fn from_env<T: FromEnv>() -> Result<T, FromEnvError>
Expand description

Convenience function to load a FromEnv type from environment variables.

Equivalent to <T as FromEnv>::from_env() but doesn’t require importing the FromEnv trait.

§Example

let config: Config = dotenv::from_env().unwrap();