Converts a serializable Rust value into Python dictionaries and lists.
(py: Python<'_>, value: &T)
| 19 | |
| 20 | /// Converts a serializable Rust value into Python dictionaries and lists. |
| 21 | pub(crate) fn to_python<T: Serialize>(py: Python<'_>, value: &T) -> PyResult<Py<PyAny>> { |
| 22 | pythonize(py, value) |
| 23 | .map(|object| object.unbind()) |
| 24 | .map_err(|error| PyValueError::new_err(error.to_string())) |
| 25 | } |
| 26 | |
| 27 | /// Converts an arbitrary Python object into a JSON value. |
| 28 | pub(crate) fn value_from_python(value: &Bound<'_, PyAny>) -> PyResult<Value> { |
no test coverage detected