| Crates.io | facet-postcard-legacy |
| lib.rs | facet-postcard-legacy |
| version | 0.36.0 |
| created_at | 2025-12-29 20:40:22.050172+00 |
| updated_at | 2025-12-29 20:40:22.050172+00 |
| description | Legacy Postcard binary serialization for Facet types - use facet-postcard instead |
| homepage | https://facet.rs |
| repository | https://github.com/facet-rs/facet |
| max_upload_size | |
| id | 2011315 |
| size | 342,794 |
Postcard serialization and deserialization for Facet types.
Postcard is a compact, efficient binary serialization format designed for embedded and no_std environments. This crate provides byte-for-byte compatible output with the standard postcard crate, while using Facet's reflection capabilities instead of serde.
postcard crateno_std support with the alloc featureuse facet::Facet;
use facet_postcard_legacy::{to_vec, from_slice};
#[derive(Debug, Facet)]
struct Message {
id: u32,
payload: Vec<u8>,
}
// Serialize
let msg = Message { id: 42, payload: vec![1, 2, 3] };
let bytes = to_vec(&msg).unwrap();
// Deserialize
let decoded: Message = from_slice(&bytes).unwrap();
For no_std environments without an allocator, use to_slice:
# use facet::Facet;
# #[derive(Debug, Facet)]
# struct Message { id: u32, payload: Vec<u8> }
# let msg = Message { id: 42, payload: vec![1, 2, 3] };
let mut buf = [0u8; 64];
let used = facet_postcard_legacy::to_slice(&msg, &mut buf).unwrap();
std (default): Enables standard library support
alloc: Enables heap allocation without full std (for no_std with allocator)
Thanks to all individual sponsors:
...along with corporate sponsors:
...without whom this work could not exist.
The facet logo was drawn by Misiasart.
Licensed under either of:
at your option.