Skip to main content

templates

Macro templates 

macro_rules! templates {
    (
        group = $group:literal,
        variant = $variant:ident,
        ty = $ty:ty,
        builder = $builder:path,
        table = $table:ident,
        { $( $name:ident = $code:literal => ( $($arg:expr),* $(,)? ) ),* $(,)? }
    ) => { ... };
}
Expand description

Declares a group of templates sharing one builder: per entry, emits a typed accessor pub fn <name>() -> <ty> (calling <builder>(<code>, <args…>), so the code doubles as the template name with no duplication) and a row in the group’s static table. The schema lives in the builder; this macro only wires name/code/args and tags the variant.