Trait pyo3::typeob::PyObjectAlloc[][src]

pub trait PyObjectAlloc<T> {
    unsafe fn alloc(py: Python) -> PyResult<*mut PyObject>;
unsafe fn dealloc(py: Python, obj: *mut PyObject); unsafe fn drop(_py: Python, _obj: *mut PyObject) { ... } }

A Python object allocator that is usable as a base type for #class

Required Methods

Allocates a new object (usually by calling ty->tp_alloc),

Calls the rust destructor for the object and frees the memory (usually by calling ptr->ob_type->tp_free). This function is used as tp_dealloc implementation.

Provided Methods

Calls the rust destructor for the object.

Implementors