faml
English | 简体中文
Faml is a dynamic configuration scripting language that can embed script code in the configuration file to achieve dynamic configuration update.
Manual
Install: Run cargo add faml in the project directory
English | 简体中文
Faml is a dynamic configuration scripting language that can embed script code in the configuration file to achieve dynamic configuration update.
Install: Run cargo add faml in the project directory
fn main() -> anyhow::Result<()> {
let faml_str = r#"
[hello]
value = 12
name = $"hello {value + 12}"
"#;
let mut root = faml::FamlExpr::from_str(faml_str)?;
root["hello"]["value"].set_int(30);
println!("{}", root["hello"]["name"].evaluate()?.as_str()); // hello 42
Ok(())
}