mikedilger on Nostr: serde is really good (if a bit complicated) for going from your types to an iteration ...
serde is really good (if a bit complicated) for going from your types to an iteration of well known fundamental types, being encoding-agnostic, then serde_json takes it to/from JSON. It's a solid system.
Published at
2022-11-21 01:01:19Event JSON
{
"id": "6499f7a3f76a93944f1280ccc7fa4bce2a329dd3d5077b33a8391d097b03bca0",
"pubkey": "ee11a5dff40c19a555f41fe42b48f00e618c91225622ae37b6c2bb67b76c4e49",
"created_at": 1668992479,
"kind": 1,
"tags": [
[
"p",
"8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168",
"wss://relay.nostr.info"
],
[
"e",
"d702e3ee68fe40e39947bf5ee9a551a112c7ffc8274acee508307cec80230fe8",
"wss://nostr.onsats.org",
"root"
],
[
"e",
"ca9658996bf199b93585f96e7a7edde80edc2cbda6828344ec418f82383b3891"
]
],
"content": "serde is really good (if a bit complicated) for going from your types to an iteration of well known fundamental types, being encoding-agnostic, then serde_json takes it to/from JSON. It's a solid system.\n",
"sig": "db9b4c9ffd33d748db81e57491ee956f4701eb5f146010d56e6400674bc9ff0d988cb4bea2a612cd61d45bd910375e801ab605f381e2afce40e85f9ff692efce"
}