alef-codegen 0.15.39

Shared codegen utilities for the alef polyglot binding generator
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{%- if derives %}
#[derive({{ derives | join(", ") }})]
{%- endif %}
{%- for attr in attrs %}
#[{{ attr }}]
{%- endfor %}
{{ visibility }} struct {{ name }} {
{%- for name, ty, attrs, doc in fields %}
{%- if doc %}
    /// {{ doc.replace('\n', '\n    /// ') }}
{%- endif %}
{%- for attr in attrs %}
    #[{{ attr }}]
{%- endfor %}
    pub {{ name }}: {{ ty }},
{%- endfor %}
}