liveBook · Manning

Deserialization

As explained in Refactoring to Rust

Deserialization is the conversion of a stored or transmitted representation into in-memory program values.

Deserialization converts data-format representations into Rust values. Serde supplies the generic Deserialize trait, while serde_json connects that model to JSON. section 6.3

Parsing and using JSON data

A parsed Data value can feed ordinary Rust logic: summing the name length and numeric value produces 948146 for the sample input, matching a Python implementation.

Figure 6.1 The Serde ecosystem
figure

The Serde ecosystem diagram helps distinguish the generic serialization framework from format-specific bridges such as serde_json. section 6.3

How Refactoring to Rust covers it

How deep it goes
Explains generic traits, derived implementations, type inference, dependency setup, successful parsing, and runtime type errors.
Examples
Uses name-and-value JSON objects, derived Data structs, compiler errors, runtime type errors, and a Python comparison.
What you can do after
Apply it via serde_json to parse JSON strings into typed Rust values and use their fields.
How it connects
Connects deserialization to Serde, serde_json, JSON, serialization, Cargo, and Rust data structures.

Also explained in

Compare how 10 books explain deserialization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.