Attempt to convert a Python object to an instance of `T`. Generally this only supports Python types that match `serde`'s object model well: - integers (including arbitrary precision integers if the `arbitrary_precision` feature is enabled) - floats - strings - bytes - `collections.abc.Sequence` instances (as serde sequences) - `collections.abc.Mapping` instances (as serde maps) - dataclasses (as
(obj: &'a Bound<'py, PyAny>)
| 19 | /// - `collections.abc.Mapping` instances (as serde maps) |
| 20 | /// - dataclasses (as serde maps) |
| 21 | pub fn depythonize<'a, 'py, T>(obj: &'a Bound<'py, PyAny>) -> Result<T> |
| 22 | where |
| 23 | T: Deserialize<'a>, |
| 24 | { |
| 25 | T::deserialize(&mut Depythonizer::from_object(obj)) |
| 26 | } |
| 27 | |
| 28 | /// A structure that deserializes Python objects into Rust values |
| 29 | pub struct Depythonizer<'a, 'py> { |
no outgoing calls