facet-postcard
Postcard binary format for facet.
This crate provides serialization and deserialization for the postcard binary format.
Serialization
Serialization supports all types that implement facet_core::Facet:
use Facet;
use to_vec;
let point = Point ;
let bytes = to_vec.unwrap;
Deserialization
There is a configurable Deserializer API plus convenience functions:
from_slice: Deserializes into owned types (T: Facet<'static>)from_slice_borrowed: Deserializes with zero-copy borrowing from the input bufferfrom_slice_with_shape: Deserializes intoValueusing runtime shape informationfrom_slice_into: Deserializes into an existingPartial(type-erased, owned)from_slice_into_borrowed: Deserializes into an existingPartial(type-erased, zero-copy)
use from_slice;
// Postcard encoding: [length=3, true, false, true]
let bytes = &;
let result: = from_slice.unwrap;
assert_eq!;
Deserialization is driven by facet-format over the postcard parser, so all
supported Facet shapes use the same parser/deserializer path.