#[derive(Template)]
{
// Attributes available to this derive:
#[template]
#[template_inline]
#[dedent]
}
Expand description
Derive the Template
trait.
The template can be specified with either #[template]
or #[template_inline]
.
Use the dedent option to automatically dedent content in blocks.
§Examples
ⓘ
#[derive(Debug, Template)]
#[template = "./hello.template"] // Path is relative to the src folder
struct MyTemplate<'a> { name: &'a str }
ⓘ
#[derive(Debug, Template)]
#[template_inline = "Hello {{ name }}!"]
struct MyTemplate<'a> { name: &'a str }