serde_binary_adv/
lib.rs

1//! # Serde Binary Advanced
2//!
3//! Serde Binary Advanced is a [Serde](https://crates.io/crates/serde) library enabling the
4//! serialization and deserialization of Rust objects to and from binary representations.
5//!
6//! ## Features
7//!
8//! - Serialization and deserialization of Rust data structures to and from raw binary format
9//! - Full support for all Rust native types
10//! - Comprehensive error reporting
11//!
12//! ## Installation
13//!
14//! Add this to your Cargo.toml:
15//!
16//! ```toml
17//! [dependencies]
18//! serde = { version = "1", features = ["derive"] }
19//! serde_binary_adv = { version = "1" }
20//! ```
21//!
22//! ## Usage
23//!
24//! Here's a quick example on how to use Serde Binary Advanced to serialize and deserialize a struct to and from binary:
25//!
26//! ```rust
27//! use serde::{Serialize, Deserialize};
28//!
29//! # [derive(Serialize, Deserialize)]
30//! struct Point {
31//!     x: i64,
32//!     y: i64,
33//! }
34//!
35//! fn main() -> Result<(),Error> {
36//!     let point = Point { x: 1.0, y: 2.0 };
37//!
38//!     // Serialize to bytes
39//!     let raw: Vec<u8> = serde_binary_adv::to_bytes(&point)?;
40//!     assert_eq!(raw, vec![0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02]);
41//!
42//!     // Deserialize from bytes
43//!     let deserialized_point: Point = serde_yml::from_bytes(&raw)?;
44//!     assert_eq!(point, deserialized_point);
45//!
46//!     Ok(())
47//! }
48//! ```
49//!
50//! ## Legal
51//!
52//! Serde Binary Advanced is copyright &copy; 2025 JEleniel and released under either [The MIT License](LICENSE-MIT.md)
53//! or [The Apache License](LICENSE-Apache.md), at your option.
54//!
55//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you
56//! shall be licensed as above, without any additional terms or conditions.
57mod serde_binary_adv;
58
59pub use serde_binary_adv::*;
60
61#[cfg(test)]
62mod tests {}