Skip to main content

load_yaml_with_env

Function load_yaml_with_env 

Source
pub fn load_yaml_with_env<T: DeserializeOwned>(
    path: &Path,
) -> Result<T, Box<dyn Error>>
Expand description

Loads a YAML file, interpolates environment variables, and deserializes into T.

Interpolation runs on the raw text before YAML parsing, so ${VAR} works anywhere in the file — keys, values, and free-form plugin config alike. Returns an error if the file is unreadable or the interpolated text does not deserialize into T.