Macro rust_decouple::config
source · macro_rules! config { ($var_name:expr, $default_value:expr) => { ... }; ($var_name:expr) => { ... }; }
Expand description
Macro for Environment parser
§Usage
let variable: u8 = config!("U8_VAR");
let variable_with_default: i32 = config!("NOT_DEFINED_I32_VAR", 0);
// Automatically inferred that `variable_with_default_and_type_inferred` is u8 due to the default value
let variable_with_default_and_inferred_type = config!("VAR", 0u8);