serde_json bridges Serde’s generic serialization model and the JSON data format. Use serde_json::from_str to deserialize a JSON string into a typed Rust structure. section 6.3 section 6.7
A minimal typed JSON parser requires:
- Derive serde::Deserialize for the destination struct and Debug if it will be printed with {:?}. section 6.3
Parsing a JSON object
With #[derive(Debug, serde::Deserialize)] on Data, serde_json::from_str parses { "name": "Sharpe Oliver", "value": 134087 } into Data and prints its fields. A mismatched field type produces a deserialization error; calling unwrap then panics.
Figure 6.1 The Serde ecosystem
The ecosystem diagram helps distinguish Serde’s format-independent data model from serde_json’s JSON-specific bridge. section 6.3

