Trait cpython::py_class::PythonObjectFromPyClassMacro

source ·
pub trait PythonObjectFromPyClassMacro: PythonObjectWithTypeObject {
    // Required methods
    fn initialize(py: Python<'_>, module_name: Option<&str>) -> PyResult<PyType>;
    fn add_to_module(py: Python<'_>, module: &PyModule) -> PyResult<()>;
}
Expand description

Trait implemented by the types produced by the py_class!() macro.

This is an unstable implementation detail; do not implement manually!

Required Methods§

source

fn initialize(py: Python<'_>, module_name: Option<&str>) -> PyResult<PyType>

Initializes the class.

module_name: the name of the parent module into which the class will be placed.

source

fn add_to_module(py: Python<'_>, module: &PyModule) -> PyResult<()>

Initializes the class and adds it to the module.

Object Safety§

This trait is not object safe.

Implementors§