pyo3::conversion

Module test_no_clone

Source
Expand description
use pyo3::prelude::*;

#[pyclass]
struct TestClass {
    num: u32,
}

let t = TestClass { num: 10 };

Python::with_gil(|py| {
    let pyvalue = Py::new(py, t).unwrap().to_object(py);
    let t: TestClass = pyvalue.extract(py).unwrap();
})
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here