How it works...
In many languages, creating a template engine is somewhat like an introduction tutorial—which is probably where the name Yarte comes from. While the choices are many, actix-web provides examples with three other engines as well; we recommend checking them out in their GitHub repository (https://github.com/actix/examples). Step 1 of this recipe already covers some of the important work: importing stuff and declaring the view models (as in the MVVM pattern: https://blogs.msdn.microsoft.com/msgulfcommunity/2013/03/13/understanding-the-basics-of-mvvm-design-pattern/). Yarte provides macro attributes that associate a particular model with a template file—and it automatically finds the templates folder. If that does not suit your ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access