Skip to main content

Crate exbytes

Crate exbytes 

Source
Expand description

Extensions for Bytes and BytesMut providing variable-length integer encoding (unsigned LEB128 and signed ZigZag).

§LEB128

Unsigned LEB128 encodes an integer in 7-bit groups, most significant group first, with the high bit set on every byte except the last.

§ZigZag

ZigZag maps signed integers to unsigned LEB128 by interleaving positive and negative values: 0 → 0, -1 → 1, 1 → 2, -2 → 3, …, so that small absolute values produce small encoded outputs.

Enums§

TryGetLebError
Errors that can occur when decoding a LEB128 value.

Traits§

BytesExt
Extension trait providing LEB128 and ZigZag decoding on Bytes / BytesMut.
BytesMutExt
Extension trait providing LEB128 and ZigZag encoding on BytesMut.