alef 0.62.9

Opinionated polyglot binding generator for Rust libraries
Documentation
{% for import in imports %}{{ import }}
{% endfor %}

{% if is_async %}#[tokio::main]
async fn main() {
{% else %}fn main() {
{% endif %}
{% for line in body %}{{ line }}
{% endfor %}
{% if expects_error %}    match {{ result_var }} {
{% if returns_void %}        Ok(_) => {}
{% else %}        Ok(value) => println!("{:?}", value),
{% endif %}        Err(error) => println!("{error}"),
    }
{% else %}{% if display_result %}    println!("{:?}", {{ result_var }});
{% endif %}
{% for operation in presentation %}
{% if operation.kind == "show" %}    println!("{% if operation.display %}{}{% else %}{:?}{% endif %}", {{ operation.expression }});
{% else %}    for {{ operation.item }} in {{ operation.expression }}{% if operation.optional %}.iter().flatten(){% endif %} {
{% for field in operation.fields %}        println!("{% if operation.display %}{}{% else %}{:?}{% endif %}", {{ field }});
{% endfor %}    }
{% endif %}
{% endfor %}{% endif %}
}