How it works...
Statically typed languages like Rust make programming a lot more comfortable once types are established. However, in a world with ever-changing web service APIs, a simple additional property can lead to a parser error, making it impossible to continue. Therefore, serde does not only support fully automated parsing but also dynamically extracting data from its Value type, complete with type parsing.
In step 1, we add the various dependencies, all of which comply with the serde interfaces (which are located in the serde crate)—although they come from different sources. Using them is demonstrated in step 2 and later.
We begin with creating a raw string that contains a JSON string for serde_json to parse. Once the Value variable ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access