Skip to main content

parse_static

Function parse_static 

Source
pub fn parse_static(name: &str, raw: &str) -> Result<Tera>
Expand description

Parse a static (compile-time) Tera template, returning a tera::Tera instance with the template registered under name.

Use this for “trusted” templates baked into the binary (PKGBUILD body, cask/formula skeletons, nuspec, etc.) where parse failure is a programmer bug, but we still want the error to flow through Result rather than a panic site so the anti-pattern hook stays clean and the caller’s stage label reaches the user as .with_context(...)?.