macro_rules! env_var_with_defaults {
($key: expr, Option::<$type: ty>, $default: expr ) => { ... };
($key: expr, Option::<$type: ty>) => { ... };
($key: expr, $default: expr) => { ... };
($key: expr, $type: ty, $default: expr ) => { ... };
}Expand description
Read environment variable using a key and default value.
-
When only (key, default_value) is passed, returns the value or the default value.
-
When the
key, value returntypeas anOptionanddefault_valueis passed, the environment variable is read for the key and the value is parsed into thetypepassed as argument. If the value is not found, then the default value is assigned. -
When the
key, value returntypeanddefault_valueis passed, the environment variable is read for the key and the value is parsed into thetypepassed as argument. If the value is not found, then the default value is assigned.