alef 0.24.13

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
    /// {{ doc }}.
    pub fn {{ method_name }}(
        self: *{{ service_name }},
        callback: *const fn (*anyopaque, [*:0]const u8) callconv(.C) [*:0]u8,
        context: *anyopaque{{ params_decl }}
    ) c_int {
        const owner_ptr = self.owner orelse return 1;

        return c.{{ c_fn }}(
            @ptrCast(owner_ptr),
            @ptrCast(callback),
            context{{ args }}
        );
    }