2021-02-09 23:36:13 +03:00

24 lines
667 B
Handlebars

{{~#each packets as |p|}}
{{~#if p.fields}}
#[derive(Packet, Debug)]
pub struct {{p.name}} {
{{~#each p.fields as |f|}}
{{~#if f.var_int}}
#[packet(with = "var_int")]{{/if}}
{{~#if f.var_long}}
#[packet(with = "var_long")]{{/if}}
{{~#if f.rest}}
#[packet(with = "rest")]{{/if}}
{{~#if f.hyphenated}}
#[packet(with = "uuid_hyp_str")]{{/if}}
{{~#if f.max_length}}
#[packet(max_length = {{f.max_length}})]{{/if}}
{{~#if (ne f.type "RefType")}}
pub {{f.name}}: {{f.type}}{{#unless @last}},{{/unless}}
{{~else}}
pub {{f.name}}: {{f.ref_name}}{{#unless @last}},{{/unless}}
{{~/if}}
{{~/each}}
}
{{/if}}
{{~/each}}