Here's how to serialize/deserialize to JSON your own custom structs.
https://play.rust-lang.org/?edition=2018&gist=72755f28f99afc95e01d63174b28c1f5 …
#Rustlang
-
Show this thread
-
This is incredibly useful when, for example, GETing data from a REST service. https://github.com/cgcardona/bitcoincash/blob/master/src/util/address.rs#L8-L26 … You can deserialize JSON directly in to a custom structhttps://github.com/cgcardona/bitcoincash/blob/master/src/util/address.rs#L66 …
1 reply 0 retweets 1 likeShow this thread
Replying to @cgcardona
Also it's much more efficient than deserializing into a bunch of hashmaps and manipulating those to make the struct, as most languages' json libraries would do. In fact it's more efficient than just deserializing to hashmaps at all, with no structs.
1:58 PM - 29 Oct 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.