alef 0.34.5

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13

def {{ fn_name }}({% if fields %}native{% else %}_native{% endif %}: Any) -> {{ class_name }}:
    """Build the public `{{ class_name }}` dataclass from the native binding object."""
{% if fields %}
    return {{ class_name }}(
{% for f in fields %}
        {{ f.name }}={{ f.expr }},
{% endfor %}
    )
{% else %}
    return {{ class_name }}()
{% endif %}