Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Serialize Data Structures With Key Value Pairs In Rust

Add this to enums :

rust
use serde::Serialize;

#[derive(Debug, PartialEq, Serialize)]
#[serde(tag = "type", content = "content", rename_all = "lowercase")]
pub enum Widget {
  Alfa,
  Bravo
}

That will display the type for each element so you can access them by key in (for example) minijinja

[] talk about the different parts there and the derive stuff that helps with the basic usage

Footnotes And References