Implement different Askama templates for different enum variants.
```rust
enum MyEnum<'a, T: std::fmt::Display> {
// uses the default #[template]
A,
// uses specific `#[template]`
#[template(ext = "html", source = "B")]
B,
// you can use tuple structs
#[template(
ext = "html",
source = "{{self.0}} {{self.1}} {{self.2}} {{self.3}}",
)]
C(u8, &'a u16, u32, &'a u64),
// and named fields, too
#[template(ext = "html", source = "{{some}} {{fields}}")]
D { some: T, fields: T },
}
asserteq!( MyEnum::A::<&str>.tostring(), "default", ); asserteq!( MyEnum::B::<&str>.tostring(), "B", ); asserteq!( MyEnum::C::<&str>(1, &2, 3, &4).tostring(), "1 2 3 4", ); asserteq!( MyEnum::D { some: "some", fields: "fields" }.tostring(), "some fields", ); ```