pub fn from_pyobject_pyo3<T>(
py: Python<'_>,
value: &Bound<'_, PyAny>,
) -> Result<T, PyErr>where
T: DeserializeOwned,Expand description
Convert a Python object to a Rust type that implements DeserializeOwned.
ยงErrors
Returns an error if:
- The Python object cannot be serialized to JSON.
- The JSON string cannot be deserialized to type
T. - The Python
jsonmodule fails to import or execute.