pub fn parse_string<'a>(
input: &str,
base_dir: impl AsRef<Path>,
parameters: impl Iterator<Item = &'a str>,
) -> Result<String, Error>Expand description
Parses a file using the templating engine.
§Parameters
input: the contents to processbase_dir: all includes are resolved relative to this directoryparameters: ifinputcontains any parameter macros, pass an iterator to them here. Otherwise passstd::iter::empty().
§Example
let res = parse_string(
"#define A 4\nThe answer is A",
std::env::current_dir().unwrap(),
std::iter::empty()
).unwrap();
assert_eq!(res, "The answer is 4");