skip to Main Content

Stream writing to a JSON file

I am implementing a JSON export functionality in my project. Earlier, I was building the JSON in memory (by storing the data in structs) and writing them to the target file using serde_json::to_string(data). But now the JSON structure is getting…

VIEW QUESTION

Deserialize JSON object (as text) inside JSON bject

I'm looking for a better solution for deserializing nested JSON object like this {"name":"John Doe","age":43,"address":"{"street":"10 Downing Street","city":"London"}"} Using this code I do the job use serde_derive::{Deserialize, Serialize};use serde_json::{Result, Value}; #[derive(Serialize, Deserialize)] struct Person{ name: String, address: Value } #[derive(Debug, Serialize,…

VIEW QUESTION
Back To Top
Search