James Lewis on Nostr: [learning Rust] Something I am realizing right now is that if I am to start using ...
[learning Rust]
Something I am realizing right now is that if I am to start using Rust for my web apps, I am going to have to be pretty careful about JSON ingest, specifically handling `NULL`s and other ambiguous typing that comes with many APIs.
When I get JSON data and parse it, I need the data to be very well organized, properly typed, and predictable.
Q: For those who are Rust devs (especially those of you who use Yew+Wasm), when you receive JSON into your application do you usually parse first into a JSON struct/enum first to sanitize then construct your target or do you parse directly into your target strct/enum?
#askNostr #Rust #webDev
Published at
2023-12-29 15:03:01Event JSON
{
"id": "1c5db59df3cf4dc451f5fa0c23bcec9fa6460667663d2d97da9729d23ce9292a",
"pubkey": "9a4acdeb978565e27490dca65c83e9f65745eaec1d9a0405a52d198c1489913b",
"created_at": 1703862181,
"kind": 1,
"tags": [],
"content": "[learning Rust]\nSomething I am realizing right now is that if I am to start using Rust for my web apps, I am going to have to be pretty careful about JSON ingest, specifically handling `NULL`s and other ambiguous typing that comes with many APIs.\n\nWhen I get JSON data and parse it, I need the data to be very well organized, properly typed, and predictable.\n\nQ: For those who are Rust devs (especially those of you who use Yew+Wasm), when you receive JSON into your application do you usually parse first into a JSON struct/enum first to sanitize then construct your target or do you parse directly into your target strct/enum?\n\n#askNostr #Rust #webDev",
"sig": "2ee0007ba9ca92f262af41ee1ac50998cfa749e906085bb8d08a688fe2056d068758d1b218fad4b258f9b461b294336d1b30a3abe6fcbb525a487e5276c80dad"
}