Rust Programming Tutorial #42 - Parsing JSON

preview_player
Показать описание
I tend to use JSON in almost all of my projects, the simple data format is friendly and supported by pretty much every programming language, including Rust. By using the 'serde_json' library you are able to work with JSON - in this video I talk specifically about parsing JSON.

Parsing/decoding JSON can be done in two ways: you can access data using a simple array-like data structure (serde_json::Value) or you can conveniently map the JSON string to an actual programmer-defined struct. In this video I show you both ways.

This is all thanks to the serde_json library, take a look and say thank you here:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Please continue this awesome tutorial series with mini projects.

sbn
Автор

out of all rust tutrials i could find on yt this was the best one by far, thnx for 42 awsome lessons

assblasterturbo
Автор

Hey man, just finished watching this series. As a JS dev looking to learn some Rust, this was a great way to get my feet wet. Thanks for making these!

ThePassle
Автор

This playlist has been really great thank you!

AlfredLotsu
Автор

This was an incredible series of videos! I feel a void now that I've finished.
Please make more if you have the time and energy!

NeotenicApe
Автор

Awesome series! If you are going to keep making videos about this that would be awesome!

retrogamingbros
Автор

Just completed this series. Excellent! thank you for your time and effort!

LakshmipathiG
Автор

What a great series! Please make more about Rust ❤

lifehackspro
Автор

just got to the end wish there was more

PseudoDope
Автор

May i suggest that you showcase RON? as it's a serialization format specifically for rust. very similar to JSON, but it let's you store structs, enums etc.

mtothem
Автор

Well I have as well just finished the series, thank you for the nice tutorials, and to the viewers thanks for the helpfull comments :)

crowncrow
Автор

Great series, watched all except this video.

alexmattheis
Автор

Beautiful tutorial playlist!!! One questions please.. i have as code editor VSCode, and i want install Atom. How is name of the extension rust-analyzer by VSCode, relative to Atom?

domenicopetrosillo
Автор

Could you make a video about how we can append to a specific field of a json file?

hueseyinguendogan
Автор

anyone else hear "40 second rust tutorial"?

bjrnsen
Автор

What if you have a nested Json with an array? How would you define a struct for that? (for example when defining a Tshirt that has multiple colors and sizes )

alexd
Автор

Great video, really helpful but how to deal with nested JSONs ? as in this example it was just 1 person. But if they are many in a single json file which are usually labelled as 0:, 1: each containing block of data.

thelinuxgamelab
Автор

Thank you very much. Very informative vide

merkg
Автор

What if you have a more complex data structure, for example if the person objects has an attribute wardrobe?

So for each person you have the data items Name, Age, is_male, and a vector structure (or other container) with red shirt, blue shirt, black trousers.

matthewbaynham
Автор

The first part of this video is interesting however I would still need to get the response from a reqwest::Client object to be a string. So how would I convert reqwest::Client response to a string?

matthewbaynham