// the find
jamesmunns/postcard
A no_std + serde compatible message library for Rust
Postcard is a binary serialization format for Rust built on serde, designed specifically for no_std environments like microcontrollers. It uses varints for integer encoding to keep wire size small, and has a stable v1 format spec. The target audience is embedded Rust developers who want to pass typed structs over UART/radio/whatever without pulling in JSON or MessagePack.
The wire format is documented and stable since v1.0.0 — there's an actual spec in the repo, not just 'whatever the code does'. The Flavors system for layering CRC, COBS encoding, or size-prefixing on top of the base format is genuinely well-designed; you compose them rather than hardcoding protocol framing. postcard-schema gives you a hash of the type's shape, which lets you detect schema mismatches between firmware and host without a versioning protocol. The postcard2 crate in this repo suggests active work on the next iteration without breaking the stable v1.
Several serde attributes silently break things — serde(flatten) and serde(skip_serializing_if) are known bad, and serde(skip) has a discriminant-offsetting footgun that will corrupt deserialization in non-obvious ways. There are now two parallel crate families (postcard vs postcard2, postcard-schema vs postcard-schema-ng, postcard-derive vs postcard-derive-ng) living in the same repo at different maturity levels with no clear guidance on which to use for new projects. No built-in support for schema evolution or forward compatibility — if you add a field to a struct, old firmware breaks, full stop.