1 unstable release
new 0.1.0 | Mar 14, 2025 |
---|
#74 in Magic Beans
5KB
Module for serialization and deserialization using MessagePack format.
This module provides utilities for efficiently serializing and deserializing data using the MessagePack format, which is a binary serialization format that is more compact than JSON and supports more data types.
Example
use std::io::Cursor;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize, PartialEq, Debug)]
struct Person {
name: String,
age: u32,
}
let person = Person {
name: "Alice".to_string(),
age: 30,
};
let mut buffer = Vec::new();
serialize(&person, &mut buffer).unwrap();
let deserialized: Person = deserialize(Cursor::new(&buffer)).unwrap();
assert_eq!(person, deserialized);
Dependencies
~470–790KB
~15K SLoC