Expand description
std::io::{Read, Write} positive, primitive Rust integers in the Most Significant Base 128 (MSB128) variable-length encoding. MSB128 is also known as Variable Length Quantity (VLQ) encoding and similar to the Little Endian Base 128 (LEB128) encoding (other endianness).
Each byte is encoded into 7 bits, and one is subtracted (excluding the last byte). The highest bit indicates if more bytes follow. Reading stops after a byte with the highest bit set is read or if the underlying Rust primitive overflows.
Enums§
- Read
Error - An error type for reading MSB128 encoded integers.
- Write
Error - An error type for writing MSB128 encoded integers.
Functions§
- read_
positive - Read a variable length and MSB128-encoded integer from
r
. The returned integer is positive. Reading negative integers is not supported. - write_
positive - Write
val
to thestd::io::Write
streamw
as an MSB128-encoded integer.