pyo3::impl_::pymodule

Trait PyAddToModule

Source
pub trait PyAddToModule: Sealed {
    // Required method
    fn add_to_module(
        &'static self,
        module: &Bound<'_, PyModule>,
    ) -> PyResult<()>;
}
Expand description

Trait to add an element (class, function…) to a module.

Currently only implemented for classes.

Required Methods§

Source

fn add_to_module(&'static self, module: &Bound<'_, PyModule>) -> PyResult<()>

Implementors§

Source§

impl PyAddToModule for PyMethodDef

For adding a function to a module.

Source§

impl PyAddToModule for ModuleDef

For adding a module to a module.

Source§

impl<T: PyClass> PyAddToModule for AddClassToModule<T>

Source§

impl<T: PyTypeInfo> PyAddToModule for AddTypeToModule<T>

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here