Cargo Features

postcard-rpc has no features set by default.

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

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

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

test-utils = use-std

Enables use-std of postcard-schema

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_3-server

Enables embassy-executor ^0.5, embassy-sync, embassy-usb, embassy-usb-driver, futures-util, 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