Skip to main content

Module indexed

Module indexed 

Source
Expand description

A binary encoding of sequences of byte slices.

The encoding starts with a sequence of n+1 offsets describing where to find the n slices in the bytes that follow. Treating the offsets as a byte slice too, each offset indicates the location (in bytes) of the end of its slice. Each byte slice can be found from a pair of adjacent offsets, where the first is rounded up to a multiple of eight. This means that slices that are not multiples of eight bytes may leave unread bytes at their end, which is fine.

Structs§

DecodedStore
A zero-allocation view into indexed-encoded data, providing random access to individual slices.

Functions§

decode
Decodes an encoded sequence of byte slices. Each result will be u64 aligned.
decode_index
Decodes a specific byte slice by index. It will be u64 aligned.
encode
Encodes item into u64 aligned words.
length_in_bytes
Encoded length in number of u8 bytes required.
length_in_words
Encoded length in number of u64 words required.
validate
Validates that store contains well-formed data compatible with type T.
validate_structure
Validates the internal structure of indexed-encoded data.
write