Expand description
binout
is the Rust library by Piotr Beling for low-level, portable, bytes-oriented,
binary encoding, decoding, serialization, deserialization of integers and arrays of integers.
It supports slightly improved VByte/LEB128 format (see VByte
) as well as simple, little-endian, as-is serialization (see AsIs
).
§Example
use binout::{VByte, Serializer};
let value = 123456u64;
let mut buff = Vec::new();
assert!(VByte::write(&mut buff, value).is_ok());
assert_eq!(buff.len(), VByte::size(value));
let read: u64 = VByte::read(&mut &buff[..]).unwrap();
assert_eq!(read, value);
Structs§
- AsIs
- Serialize values as-is, in little-endian bytes order.
- Read
Iter - Iterator whose each
next
call uses deserializerS
to deserialize the value of typeT
from theinput
. - VByte
- Serializer that uses improved VByte/LEB128 encoding.
Traits§
- Serializer
- Trait implemented by each serializer for the following types:
u8
,u16
,u32
,u64
,usize
(which, for portability, is always serialized the same asu64
).