Cargo Features

postcard-rpc has no features set by default.

[dependencies]
postcard-rpc = { version = "0.5.3", features = ["use-std", "test-utils", "cobs-serial", "raw-nusb", "webusb", "embassy-usb-0_2-server", "defmt"] }
use-std raw-nusb? test-utils? webusb?

Enables maitake-sync, thiserror, tokio, tracing, and trait-variant, use-std of postcard

Affects headered::to_stdvec, headered::to_stdvec_keyed, postcard-rpc::host_client

test-utils = use-std

Affects dispatch_macro::fake

cobs-serial

Cobs Serial support.

Works on: Win, Mac, Linux
Does NOT work on: WASM

Enables tokio-serial, use_std of cobs

raw-nusb = use-std

Raw (bulk) USB support

Works on: Win, Mac, Linux
Does NOT work on: WASM

Enables nusb

webusb = use-std

WebUSB support

Works on: WASM Does NOT work on: Win, Mac, Linux

NOTE: Requires the following in your .cargo/config.toml, or otherwise activated via RUSTFLAGS:

[target.wasm32-unknown-unknown]
rustflags = "--cfg=web_sys_unstable_apis"

Enables gloo, js-sys, serde_json, wasm-bindgen, wasm-bindgen-futures, and web-sys

Affects host_client::webusb

embassy-usb-0_2-server

Enables embassy-executor, embassy-sync ^0.5, embassy-usb, embassy-usb-driver, and static_cell

Affects postcard-rpc::target_server

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

cobs cobs-serial?

Affects postcard-rpc::accumulator

defmt implicit feature