Expand description
Variable length integer encoding A.K.A CompactSize
.
An integer can be encoded depending on the represented value to save space. Variable length integers always precede an array/vector of a type of data that may vary in length.
Constants§
- MAX_
ENCODABLE_ VALUE - The maximum size of a serialized object in bytes or number of elements
(for eg vectors) when the size is encoded as
CompactSize
.
Functions§
- decode_
unchecked - Gets the compact size encoded value from
slice
and moves slice past the encoding. - encode
- Encodes
CompactSize
without allocating. - encoded_
size - Returns the number of bytes used to encode this
CompactSize
value.