1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! # zerec
//!
//! Minimal zero-copy binary codec for Rust.
//!
//! - **No schema files.** Types are the schema.
//! - **No runtime reflection.** Everything is resolved at compile time.
//! - **No type tags on the wire.** You know what you are decoding into.
//! - **Little-endian, tightly packed.** No padding, no alignment waste.
//!
//! ## Quick start
//!
//! ```toml
//! [dependencies]
//! zerec = { version = "0.3", features = ["derive"] }
//! ```
//!
//! ```rust,ignore
//! use zerec::{Encode, Decode, codec::{to_bytes, from_bytes}};
//!
//! #[derive(Encode, Decode, Debug, PartialEq)]
//! struct Bullet {
//! origin: [f32; 3],
//! speed: f32,
//! damage: u32,
//! }
//!
//! let b = Bullet { origin: [1.0, 0.0, -3.5], speed: 900.0, damage: 42 };
//! let bytes = to_bytes(&b);
//! assert_eq!(from_bytes::<Bullet>(&bytes).unwrap(), b);
//! ```
//!
//! ## Wire format
//!
//! ZRC is tag-free and little-endian. See the crate-level docs or README
//! for the full encoding table.
//!
//! ## Features
//!
//! | Feature | What it enables |
//! |---------|----------------|
//! | `derive` | `#[derive(Encode, Decode)]` via `zerec-derive` |
//! | `glam` | Encode/Decode for `glam::Vec2/3/4`, `Quat`, `Mat4` |
extern crate alloc;
pub use Adapter;
pub use ;
pub use DecodeError;
pub use ZeroBuf;
// Re-export derive macros when the feature is active.
pub use ;