Handlebars templating libraries now works with Serde data
Posted on Rust Users Forum by sunng :
Just a quick update on my handlebars libraries: You can now use serde for template data.
This is implemented via a feature called
serde_type. Internally we use
serde_json::value::Valueas data type which is pretty similar to the
Jsonenum in rustc_serialize. Anything implements
serde::ser::Serializecan be rendered. To use serde for handlebars-iron, configure your Cargo.toml like this:
[features] default = ["handlebars-iron/serde_type"]
The API is fully compatible with default one so you don’t have to change any code except the data type.