Top "Serde" questions

Serde is a framework for serializing and deserializing Rust data structures efficiently and generically.

How can I deserialize an optional field with custom functions using Serde?

I want to serialize and deserialize a chrono::NaiveDate with custom functions, but the Serde book does not cover this …

json serialization rust serde
How do I use Serde to serialize a HashMap with structs as keys to JSON?

I want to serialize a HashMap with structs as keys: use serde::{Deserialize, Serialize}; // 1.0.68 use std::collections::HashMap; fn main() { #[…

rust serde serde-json
"invalid type: map, expected a sequence" when deserializing a nested JSON structure with Serde

I am trying to poll the GitHub API for issues and print them out. To do so, I need to …

json serialization rust serde serde-json
Rust & Serde JSON deserialization examples?

I'm trying to figure out how to deserialize JSON into a structure using Serde. For instance, the example JSON on …

json rust json-deserialization serde
How to deserialize a JSON file which contains null values using Serde?

I want to deserialize the chemical elements JSON file from Bowserinator on github using Serde. For this I created a …

json rust serde
How can I deserialize JSON with a top-level array using Serde?

I have a some JSON data that is returned from a web service. The JSON is a top-level array: [ { "data": "…

json rust deserialization serde
Generate pretty (indented) JSON with serde

Using the serde_json crate, I can use ::serde_json::to_string(&obj) to serialize an object into a …

json rust serde