Skip to main content

pyo3_get_value_into_pyobject

Function pyo3_get_value_into_pyobject 

Source
unsafe fn pyo3_get_value_into_pyobject<ClassT, FieldT, const OFFSET: usize>(
    py: Python<'_>,
    obj: NonNull<PyObject>,
) -> PyResult<*mut PyObject>
where ClassT: PyClass, for<'py> FieldT: IntoPyObject<'py> + Clone,
Expand description

Gets a field value from a pyclass and produces a python value using IntoPyObject for FieldT, after cloning the value.

§Safety

  • obj must be a valid pointer to an instance of ClassT
  • there must be a value of type FieldT at the calculated offset within ClassT
⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here