Module utils

Source
Expand description

Utilities for encoding and decoding.

Structs§

IncompleteBuffer
Returned when the buffer does not contains engouth bytes for decoding.
InsufficientBuffer
Returned when the encoded buffer is too small to hold the bytes format of the types.

Enums§

DecodeVarintError
Decoding varint error.

Functions§

decode_i16_varint
Decodes a value from LEB128 variable length format.
decode_i32_varint
Decodes a value from LEB128 variable length format.
decode_i64_varint
Decodes a value from LEB128 variable length format.
decode_i128_varint
Decodes a value from LEB128 variable length format.
decode_u16_varint
Decodes a value from LEB128 variable length format.
decode_u32_varint
Decodes a value from LEB128 variable length format.
decode_u64_varint
Decodes a value from LEB128 variable length format.
decode_u128_varint
Decodes a value from LEB128 variable length format.
encode_i16_varint
Encodes an i16 value into LEB128 variable length format, and writes it to the buffer.
encode_i32_varint
Encodes an i32 value into LEB128 variable length format, and writes it to the buffer.
encode_i64_varint
Encodes an i64 value into LEB128 variable length format, and writes it to the buffer.
encode_i128_varint
Encodes an i128 value into LEB128 variable length format, and writes it to the buffer.
encode_u16_varint
Encodes an u16 value into LEB128 variable length format, and writes it to the buffer.
encode_u32_varint
Encodes an u32 value into LEB128 variable length format, and writes it to the buffer.
encode_u64_varint
Encodes an u64 value into LEB128 variable length format, and writes it to the buffer.
encode_u128_varint
Encodes an u128 value into LEB128 variable length format, and writes it to the buffer.
encoded_i16_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 3, inclusive.
encoded_i32_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 5, inclusive.
encoded_i64_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 10, inclusive.
encoded_i128_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 19, inclusive.
encoded_u16_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 3, inclusive.
encoded_u32_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 5, inclusive.
encoded_u64_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 10, inclusive.
encoded_u128_varint_len
Returns the encoded length of the value in LEB128 variable length format. The returned value will be between 1 and 19, inclusive.