byteorder_pack/
lib.rs

1//! # byteorder-pack
2//!
3//! A binary data reader and writer that is similar to Python's struct module,
4//! but makes use of Rust's typing system.
5//! 
6//! ## Example
7//! 
8//! ```rust
9//! use std::io::Cursor;
10//! use byteorder_pack::UnpackFrom;
11//! 
12//! let mut cursor = Cursor::new(vec![0x01, 0x02, 0x00, 0x03, 0x00, 0x04]);
13//! 
14//! let (a, b, cd) = <(u8, u8, [u16; 2])>::unpack_from_be(&mut cursor).unwrap();
15//! 
16//! assert_eq!(a, 1);
17//! assert_eq!(b, 2);
18//! assert_eq!(cd, [3, 4]);
19//! ```
20pub use byteorder;
21
22mod pack;
23pub use pack::PackTo;
24
25mod unpack;
26pub use unpack::UnpackFrom;