alef 0.25.37

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
    /// <summary>Unregister a {{ trait_name }} implementation by name</summary>
    public static void {{ method_name }}(string name)
    {
        ArgumentNullException.ThrowIfNull(name);
        var ec = NativeMethods.Unregister{{ trait_name }}(name, out var outError);
        if (ec != 0) {
            var msg = global::System.Runtime.InteropServices.Marshal.PtrToStringUTF8(outError) ?? "Unregister failed";
            throw new {{ exception_name }}(ec, msg);
        }
    }