Mixin template for single-ownership wrappers around C pointers.
Injects the boilerplate shared by all handle types: a private _ptr field, a private constructor, a destructor that calls freeFn, copy-disable directives, and bool / ptr conversions.
Usage:
struct LlamaModel { mixin Owned!(llama_model, llama_model_free); // add factory methods and domain-specific properties below }
The injected private constructor is accessible inside the hosting struct, so factory static methods can return StructName(rawPtr) normally.
Ownership mixin. T is the pointed-to C type; freeFn is called with the pointer on destruction.
See Source File
Mixin template for single-ownership wrappers around C pointers.
Injects the boilerplate shared by all handle types: a private _ptr field, a private constructor, a destructor that calls freeFn, copy-disable directives, and bool / ptr conversions.
Usage:
The injected private constructor is accessible inside the hosting struct, so factory static methods can return StructName(rawPtr) normally.