Trait pyo3::conversion::IntoPy[][src]

pub trait IntoPy<T>: Sized {
    fn into_py(self, py: Python<'_>) -> T;
}
Expand description

Similar to std::convert::Into, just that it requires a gil token.

IntoPy<PyObject> (aka IntoPy<Py<PyAny>>) should be implemented to define a conversion from Rust to Python which can be used by most of PyO3’s methods.

Required methods

Performs the conversion.

Implementations on Foreign Types

Converts () to an empty Python tuple.

Implementors