alef 0.60.0

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
    /// Release the underlying FFI handle. Safe to call more than once.
    pub fn free(self: *{{ type_name }}) void {
        const handle = self._handle orelse return;
        self._handle = null;
        c.{{ prefix }}_{{ type_snake }}_free(@as(*c.{{ upper_prefix }}{{ type_name }}, @ptrCast(handle)));
    }