Trait pyo3::pyclass_init::PyObjectInit

source ·
pub trait PyObjectInit<T>: Sized {
    // Required methods
    unsafe fn into_new_object(
        self,
        py: Python<'_>,
        subtype: *mut PyTypeObject
    ) -> PyResult<*mut PyObject>;
    fn __private__(&self) -> PrivateMarker;
}
Expand description

Initializer for Python types.

This trait is intended to use internally for distinguishing #[pyclass] and Python native types.

Required Methods§

source

unsafe fn into_new_object( self, py: Python<'_>, subtype: *mut PyTypeObject ) -> PyResult<*mut PyObject>

§Safety
  • subtype must be a valid pointer to a type object of T or a subclass.
source

fn __private__(&self) -> PrivateMarker

This trait is private to implement; this method exists to make it impossible to implement outside the crate.

Object Safety§

This trait is not object safe.

Implementors§