[−][src]Trait pyo3::typeob::PyObjectAlloc
A Python object allocator that is usable as a base type for #[pyclass]
Required methods
unsafe fn alloc(py: Python) -> PyResult<*mut PyObject>
Allocates a new object (usually by calling ty->tp_alloc),
unsafe fn dealloc(py: Python, obj: *mut PyObject)
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
Loading content...Implementors
impl<T> PyObjectAlloc<T> for T where
T: PyObjectWithFreeList,
[src]
T: PyObjectWithFreeList,
unsafe fn alloc(_py: Python) -> PyResult<*mut PyObject>
[src]
unsafe fn dealloc(py: Python, obj: *mut PyObject)
[src]
unsafe fn drop(_py: Python, _obj: *mut PyObject)
[src]
impl<T> PyObjectAlloc<T> for T where
T: PyTypeInfo,
[src]
T: PyTypeInfo,