Crate varint [−] [src]
An implementation of Google Protobuf's Variable-Length Integers
Structs
Varint |
A struct defining a variable-length integer |
Constants
VARINT_32_MAX_BYTES |
The maximum number of bytes used by a 32-bit Varint |
VARINT_64_MAX_BYTES |
The maximum number of bytes used by a 32-bit Varint |
Functions
decode_unsigned_varint32 |
Decodes an unsigned varint32, returning a result of either a u32 or a string explaining the error |
decode_unsigned_varint64 |
Decodes an unsigned varint64, returning a result of either a u64 or a string explaining the error |
encode_signed_varint32 |
Encodes a signed i32 as a Varint |
encode_signed_varint64 |
Encodes a signed i64 as a Varint |
encode_unsigned_varint32 |
Encodes an unsigned u32 as a Varint, returning the Varint. |
encode_unsigned_varint64 |
Encodes an unsigned u64 as a Varint, returning the Varint |
zigzag_signed_int |
Transforms a signed int to an unsigned int via zig-zag transformation |
zigzag_signed_long |
Transforms a signed long to an unsigned long via zig-zag transformation |
zigzag_unsigned_int |
Transforms an unsigned int to a signed int via zig-zag transformation |
zigzag_unsigned_long |
Transforms an unsignigned long to a signed long via zig-zag transformation |