Cargo Features

postcard = { version = "1.0.8", default-features = false, features = ["use-std", "alloc", "heapless-cas", "use-defmt", "use-crc", "experimental-derive"] }
default = heapless-cas

The heapless-cas feature is set by default whenever postcard is added without default-features = false somewhere in the dependency tree.

use-std = alloc

Enables std of serde


Provide impls for common standard library types like Vec<T> and HashMap<K, V>.
Requires a dependency on the Rust standard library.

Affects, de::from_io, flavors::io, ser::to_stdvec, ser::to_stdvec_cobs, ser::to_io, flavors::io, ser::to_stdvec_crc32

alloc use-std?

Enables alloc of embedded-io ^0.4 and serde


Provide impls for types in the Rust core allocation and collections library including String, Box<T>, Vec<T>, and Cow<T>. This is a subset of std but may be enabled without depending on all of std.

Affects ser::to_allocvec, ser::to_allocvec_cobs, ser::to_allocvec_crc32

heapless-cas default = heapless

Enables cas of heapless ^0.7.0

use-defmt = defmt
use-crc = crc, paste

Affects flavors::crc, de::from_bytes_crc32, de::take_from_bytes_crc32, flavors::crc, ser::to_slice_crc32, ser::to_vec_crc32, ser::to_stdvec_crc32, ser::to_allocvec_crc32

experimental-derive = const_format, postcard-derive

Experimental features!

NOT subject to SemVer guarantees!

Affects postcard::experimental.max_size, postcard::experimental.schema

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

const_format experimental-derive?
crc use-crc?
defmt use-defmt?
embedded-io alloc?

Enables embedded-io ^0.4

Affects flavors::io.eio, de::from_eio, flavors::eio, ser::to_eio, flavors::io

heapless heapless-cas

Enables heapless ^0.7.0

Affects ser::to_vec_cobs, ser::to_vec, ser::to_vec_crc32

paste use-crc?
postcard-derive experimental-derive?