Deser: Rethinking Rust Serialization

written on September 29, 2026

Serde is an amazing serialization library for Rust. However already while at Sentry I got quite frustrated with some of the limitations. Replacing Serde is tricky because of the might that it has in the ecosystem—and because it's quite hard to actually do better without painful compromises.

Three examples of Serde corner cases:

  1. A number that is a map — with serde_json's arbitrary_precision feature, an internally tagged enum can fail with invalid type: map, expected f64 because the buffer doesn't know about the magic key used for in-band signalling.
  2. Flattening breaks integer keys — HashMap<u32, u32> parses alone but fails under #[serde(flatten)] because buffered keys stay strings.
  3. Adapters do not compose — a deserialize_with function cannot be applied inside Option/Vec without writing another wrapper function for every container.