We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Like a structured context with an ip address as the key
use tera::{Context, Tera}; #[derive(Serialize)] struct Device { pub device_ip: String, pub description: String, } fn main() { let raw_template = r#" info:{{10.0.0.1.description}} "#; let device = Device { device_ip: "10.0.0.1".into(), description: "Default device".into(), }; let mut t = Tera::default(); t.add_raw_template("template1", raw_template).unwrap(); let mut context = Context::new(); context.insert(&device.device_ip, &device); let res = t.render("template1", &context).unwrap(); println!("{:?}", res) } burst out in error: `Error { kind: Msg("Failed to parse 'template1'"), source: Some(Error { kind: Msg(" --> 2:24\n |\n2 | info:{{10.0.0.1.description}}\n | ^---\n |\n = expected `or`, `and`, `not`, `<=`, `>=`, `<`, `>`, `==`, `!=`, `+`, `-`, `*`, `/`, `%`, a filter, or a variable end (`}}`)"), source: None }) } `
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Like a structured context with an ip address as the key
The text was updated successfully, but these errors were encountered: