Skip to content

Instantly share code, notes, and snippets.

@levkk
Created August 25, 2023 19:45
Show Gist options
  • Select an option

  • Save levkk/933d9a924509e70311a69da531225594 to your computer and use it in GitHub Desktop.

Select an option

Save levkk/933d9a924509e70311a69da531225594 to your computer and use it in GitHub Desktop.
Components (Rust)
use sailfish::TemplateOnce;
#[derive(TemplateOnce)]
#[template(path = "ui_components/parent.html"]
pub struct Parent {
pub items: Vec<Child>,
pub hidden: bool,
}
#[derive(TemplateOnce)]
#[template(path = "ui_components/children/child.html")]
pub struct Child<'a> {
pub checked: bool,
pub value: &'a str,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment