Member-only story

Reading and writing a JSON file in Rust

Mousse Anis
4 min readMar 2, 2022

--

This article will introduce you to the parsing and writing of a JSON file in RUST.

Photo by Tengyart on Unsplash

As a software developer/engineer, I am sure you must have heard of JSON file or JSON format. JavaScript Object Notation, well known as JSON, is a popular lightweight data-interchange format, which is easily readable and writable by humans and machines.

JSON has gained popularity over the years due to its simplicity and ease of use with different programming languages. JSON is often used as a prototyping tool to mock data storage needs or directly as data storage.

Here is an example of a JSON file containing some information about Missy's diet (If you don't know who Missy is, I invite you to read any of my former articles here. PS: Please don't tell her that I made public her diet regiment)

As you can see, the file contains a single anonymous object, which contains two arrays, food, and missy_food_schedule. The food array includes all Missy's favorite food items, and missy_food_schedule has Missy's diet schedule for the last three days for February 2022 and…

--

--

Mousse Anis
Mousse Anis

Written by Mousse Anis

Ex Quant, now software engineer who loves to cook. Opinions/Views are my own

Responses (1)