| Crates.io | facet-postcard |
| lib.rs | facet-postcard |
| version | 0.43.2 |
| created_at | 2025-12-11 16:57:18.005979+00 |
| updated_at | 2026-01-23 18:04:45.490264+00 |
| description | Postcard binary format for facet with Tier-0 and Tier-2 JIT deserialization |
| homepage | https://facet.rs |
| repository | https://github.com/facet-rs/facet |
| max_upload_size | |
| id | 1980132 |
| size | 418,276 |
Postcard binary format for facet with Tier-0 and Tier-2 JIT deserialization support.
For statically-typed structs, enums, and primitives, facet-postcard produces
wire-compatible output with the standard postcard crate. You can serialize with
facet-postcard and deserialize with serde's postcard (and vice versa), as long as
both sides agree on the schema.
facet_value::Value)Warning:
Valueserialization uses a facet-specific tagged encoding that is NOT compatible with standard postcard.
Since postcard is not a self-describing format, there's no standard way to serialize
dynamic/any values. facet-postcard solves this by prefixing each Value with a type
tag byte:
| Tag | Type | Encoding |
|---|---|---|
| 0 | Null | (no payload) |
| 1 | Bool | 1 byte (0 or 1) |
| 2 | I64 | zigzag varint |
| 3 | U64 | varint |
| 4 | F64 | 8 bytes little-endian |
| 5 | String | varint length + UTF-8 bytes |
| 6 | Bytes | varint length + raw bytes |
| 7 | Array | varint count + tagged elements recursively |
| 8 | Object | varint count + (string key, tagged value) pairs |
| 9 | DateTime | string (RFC3339) |
This means:
Value bytes using serde's postcardValue with facet-postcardValue is involvedExample wire format for {"name": "Alice", "age": 30}:
08 # tag 8 = Object
02 # 2 entries
04 6e 61 6d 65 # key: string "name" (len=4)
05 # tag 5 = String
05 41 6c 69 63 65 # value: string "Alice" (len=5)
03 61 67 65 # key: string "age" (len=3)
03 # tag 3 = U64
1e # value: varint 30
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.