Crates.io | serde-binary-adv |
lib.rs | serde-binary-adv |
version | 1.0.0-beta.3 |
created_at | 2025-08-29 20:30:37.864278+00 |
updated_at | 2025-09-04 10:22:42.054509+00 |
description | A library for Serde to enable the serialization and deserialization of Rust structures to and from raw binary |
homepage | |
repository | https://github.com/JEleniel/serde_binary_adv |
max_upload_size | |
id | 1816800 |
size | 77,430 |
Serde Binary Advanced is a Serde library enabling the serialization and deserialization of Rust objects to binary representations.
lowlevel-types
) and UTF-8 characters and stringsusize
markers for sequences and structuresu128
and i128
typesu32
Installation
Add this to your Cargo.toml:
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_binary_adv = { version = "1.0.0-beta.3" }
lowlevel_types = { version = "1.0.0-beta.3" }
Here's a quick example on how to use Serde Binary Advanced to serialize and deserialize a struct to and from binary:
use serde::{Serialize, Deserialize};
use serde_binary_adv::{Serializer, Deserializer, BinaryError, Result}
# [derive(Serialize, Deserialize)]
struct Point {
x: f64,
y: f64,
}
fn main() {
let point = Point { x: 1.0, y: 2.0 };
let serialized = Serializer::to_bytes(&point, false).unwrap();
let deserialized: Point = Deserializer::from_bytes(&serialized, false).unwrap();
assert_eq!(value, deserialized,);
}
Serde Binary Advanced is copyright © 2025 JEleniel and released under either The MIT License or The Apache License, at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you shall be licensed as above, without any additional terms or conditions.