alef 0.62.3

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
    private static Exception GetLastError()
    {
        var code = NativeMethods.LastErrorCode();
        var ctxPtr = NativeMethods.LastErrorContext();
        var message = global::System.Runtime.InteropServices.Marshal.PtrToStringUTF8(ctxPtr) ?? "Unknown error";
{% if has_base_error %}
{% for line in variant_dispatch_lines %}
{{ line }}
{% endfor %}
        if (code == 2) return new {{ base_exception_class }}(message);
{% endif %}
        return new {{ exception_name }}(code, message);
    }