Ramhorns
Fast Mustache template engine implementation in pure Rust.
Ramhorns loads and processes templates at runtime. It comes with a derive macro
which allows for templates to be rendered from native Rust data structures without doing
temporary allocations, intermediate HashMap
s or what have you.
With a touch of magic 🎩, the power of friendship 🥂, and a sparkle of FNV hashing ✨, render times easily compete with static template engines like Askama.
What else do you want, a sticker?
Example
use ;
// Standard Mustache action here
let source = "<h1>{{title}}</h1>\
{{#posts}}<article><h2>{{title}}</h2><p>{{teaser}}</p></article>{{/posts}}\
{{^posts}}<p>No posts yet :(</p>{{/posts}}";
let tpl = new.unwrap;
let rendered = tpl.render;
assert_eq!;