Skip to main content

clone_pyclass_to_pyobject

Function clone_pyclass_to_pyobject 

Source
pub fn clone_pyclass_to_pyobject<T>(
    value: &T,
    py: Python<'_>,
) -> PyResult<Py<PyAny>>
where for<'py> T: Clone + IntoPyObject<'py, Error = PyErr>,
Expand description

Converts a cloneable PyO3-backed custom data value into a Python object.

This is intended for #[pyclass] custom data types, where PyO3 already provides IntoPyObject for owned values.

ยงErrors

Returns any conversion error reported by PyO3.