rust-impl-serde

Installation
SKILL.md

rust-impl-serde

The structured data interchange skill: how to derive Serialize / Deserialize, shape the wire format with container and field attributes, pick the right enum representation, write a custom impl when the derive is not enough, and choose between JSON, TOML, YAML, bincode, and MessagePack. Serde is a compile-time framework: no runtime reflection, zero overhead, the data-structure / data-format interaction "can be completely optimized away by the Rust compiler" (per serde.rs).

Cross-references: [[rust-impl-cargo-project]] (feature flags, the derive feature), [[rust-syntax-traits]] (Serialize / Deserialize as trait bounds, generic impls), [[rust-syntax-lifetimes]] (zero-copy deserialization with #[serde(borrow)] and 'de).


When to use this skill

  • User adds #[derive(Serialize, Deserialize)] and gets error: cannot find derive macro (forgot the derive feature).
  • User asks how to rename fields, accept legacy names, or convert all field names to camelCase at once.
  • User has an enum and asks which JSON shape to emit: tagged, untagged, adjacently tagged.
  • User wants to flatten a sub-struct into the parent shape, or pull arbitrary extra fields into a HashMap.
  • User wants zero-copy deserialization with &'a str and gets error: implementation of Deserialize is not general enough.
  • User asks whether to choose serde_json, toml, serde_yaml, bincode, or rmp-serde for a given task.
  • User asks how to write a manual Serialize / Deserialize impl when the derive cannot express the format.
  • User mixes #[serde(rename = ...)] with #[serde(alias = ...)] for a schema migration.
Installs
2
First Seen
May 24, 2026
rust-impl-serde — impertio-studio/rust-claude-skill-package