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 binary representations.
5//!
6//! ## Features
7//!
8//! - Serialization and deserialization of Rust data structures to and from binary format
9//! - Full support for ASCII (through `lowlevel-types`) and UTF-8 characters and strings
10//! - Support for Big Endian and Little Endian (default) encoding
11//! - Comprehensive error reporting
12//! - Compression of `usize` markers for sequences and structures
13//! - Support for `u128` and `i128` types
14//! - Enums and variants stored as `u32`
15//!
16//! ## Limitations
17//!
18//! - No support foe serializing or deserializing sequences or maps of unknown length
19//!
20//! ## Installation
21//!
22//! Installation
23//!
24//! Add this to your Cargo.toml:
25//!
26//! ```toml
27//! [dependencies]
28//! serde = { version = "1", features = ["derive"] }
29//! serde_binary_adv = { version = "1.0.0-beta.3" }
30//! lowlevel_types = { version = "1.0.0-beta.3" }
31//! ```
32//!
33//! ## Usage
34//!
35//! Here's a quick example on how to use Serde Binary Advanced to serialize and deserialize a struct
36//! to and from binary:
37//!
38//! ```rust
39//! use serde::{Serialize, Deserialize};
40//! use serde_binary_adv::{Serializer, Deserializer, BinaryError, Result}
41//!
42//! # [derive(Serialize, Deserialize)]
43//! struct Point {
44//! x: f64,
45//! y: f64,
46//! }
47//!
48//! fn main() {
49//! let point = Point { x: 1.0, y: 2.0 };
50//!
51//! let serialized = Serializer::to_bytes(&point, false).unwrap();
52//! let deserialized: Point = Deserializer::from_bytes(&serialized, false).unwrap();
53//! assert_eq!(value, deserialized,);
54//! }
55//! ```
56//!
57//! ## Legal
58//!
59//! Serde Binary Advanced is copyright © 2025 JEleniel and released under either
60//! [The MIT License](LICENSE-MIT.md) or [The Apache License](LICENSE-Apache.md), at your option.
61//!
62//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in
63//! this crate by you shall be licensed as above, without any additional terms or conditions.
64
65mod serde_binary_adv;
66
67pub use serde_binary_adv::*;
68
69#[cfg(test)]
70mod tests {}