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§
- TryGet
LebError - Errors that can occur when decoding a LEB128 value.
Traits§
- Bytes
Ext - Extension trait providing LEB128 and ZigZag decoding on
Bytes/BytesMut. - Bytes
MutExt - Extension trait providing LEB128 and ZigZag encoding on
BytesMut.