Crate vint32

Source
Expand description

Fast vint u32 encoding for rust. Uses at most 5 bytes.

§Examples

use vint32::encode_varint_into;
let mut output = vec![];
encode_varint_into(&mut output, 50);	
assert_eq!(output.len(), 1);

Modules§

iterator
util
vint_array

Functions§

decode_from_reader
Decode a single vint32-encoded unsigned 32-bit integer from a Read.
decode_varint
Decode a vint32-encoded unsigned 32-bit integer from an iterator. Maximum space required are 5 bytes.
decode_varint_slice
Decode a vint32-encoded unsigned 32-bit integer from a bytes slice. Maximum space required are 5 bytes. pos will be used to access the pos in the slice. pos will be incremented by the number of bytes used to dencode the u32.
encode_varint_into
vint32 encode a unsigned 32-bit integer into a vec.
encode_varint_into_writer
vint32 encode a unsigned 32-bit integer into a vec.