Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

serde attribute

An #[serde(...)] line that changes how a type or field is written and read.

Serde attributes on containers, fields, and variants adjust serialization (rename, rename_all, default, skip, skip_serializing_if, flatten, tag, content, untagged, deny_unknown_fields).

Loading interactive…

Examples

  • #[serde(rename_all = "camelCase")] writes heater_on as heaterOn, and #[serde(skip_serializing_if = "Option::is_none")] leaves out a field that is None.

Read the full section →