2024-03-11 17:33:11 -04:00
|
|
|
use sailfish::RenderOnce;
|
|
|
|
use sailfish_macros::RenderOnce;
|
2020-06-11 02:33:13 -04:00
|
|
|
|
|
|
|
struct Content<'a> {
|
|
|
|
id: u32,
|
|
|
|
address: &'a str,
|
|
|
|
phone_number: &'a str,
|
|
|
|
}
|
|
|
|
|
2024-03-11 17:33:11 -04:00
|
|
|
#[derive(RenderOnce)]
|
2020-06-11 02:33:13 -04:00
|
|
|
#[template(path = "unexpected_token.stpl")]
|
|
|
|
#[template(escape = false)]
|
|
|
|
struct UnexpectedToken<'a> {
|
|
|
|
name: &'a str,
|
2024-03-11 17:33:11 -04:00
|
|
|
content: Content<'a>,
|
2020-06-11 02:33:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!(
|
|
|
|
"{}",
|
|
|
|
UnclosedToken {
|
|
|
|
name: "Taro",
|
|
|
|
content: Content {
|
|
|
|
id: 1,
|
|
|
|
address: "oooo-xxxx",
|
|
|
|
phone_number: "000-000-0000"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.render_once()
|
|
|
|
.unwrap()
|
|
|
|
)
|
|
|
|
}
|