Crates.io | facet-msgpack |
lib.rs | facet-msgpack |
version | 0.28.0 |
created_at | 2025-04-08 22:20:29.015146+00 |
updated_at | 2025-07-25 12:18:29.546027+00 |
description | MessagePack serialization and deserialization for Facet types |
homepage | |
repository | https://github.com/facet-rs/facet-msgpack |
max_upload_size | |
id | 1626035 |
size | 138,591 |
Logo by Misiasart
Thanks to all individual and corporate sponsors, without whom this work could not exist:
Provides MessagePack serialization and deserialization for facet types.
use facet::Facet;
use facet_msgpack::to_vec;
#[derive(Facet)]
struct MyStruct {
field1: u32,
field2: String,
}
let my_instance = MyStruct {
field1: 42,
field2: "hello".to_string(),
};
// Serialize to MessagePack bytes
let bytes = to_vec(&my_instance);
println!("Serialized MessagePack: {:?}", bytes);
// Output: Serialized MessagePack: [130, 166, 102, 105, 101, 108, 100, 49, 42, 166, 102, 105, 101, 108, 100, 50, 165, 104, 101, 108, 108, 111]
// Deserialization would use from_bytes (not shown here)
Licensed under either of:
at your option.