[][src]Module terminus_store::structure::vbyte

A variable-byte encoding implementation for u64.

The canonical reference for this variable-byte encoding technique appears to be:

Hugh E. Williams and Justin Zobel. Compressing integers for fast file access. The Computer Journal, 42:193–201, 1999.

There are a number of different implementations for variable-byte encoding. This particular implementation follows the reference Java implementation for the RDF HDT project. Another popular implementation is the one for Google's Protocol Buffers; however, that differs on where the most significant bit (msb) is set and cleared.

Enums

DecodeError

An error returned by decode.

Constants

MAX_ENCODING_LEN

The maximum number of bytes required for any u64 in a variable-byte encoding.

Functions

decode

Decodes a u64 from a variable-byte-encoded slice.

encode_slice

Encodes a u64 by writing its variable-byte encoding to a slice.

encode_vec

Encodes a u64 with a variable-byte encoding in a Vec.

encoding_len

Returns the number of bytes required for a u64 in its variable-byte encoding.

write_async

Encodes a u64 with a variable-byte encoding in a Vec and writes that Vec to the destination dest in a future.