[][src]Module solana_libra_vm::file_format_common

Constants for the binary format.

Definition for the constants of the binary format, used by the serializer and the deserializer. This module also offers helpers for the serialization and deserialization of certain integer indexes.

We use LEB128 for integer compression. LEB128 is a representation from the DWARF3 spec, http://dwarfstd.org/Dwarf3Std.php or https://en.wikipedia.org/wiki/LEB128. It's used to compress mostly indexes into the main binary tables.

Structs

BinaryData

A wrapper for the binary vector

Enums

BinaryConstants

Constant values for the binary format header.

Opcodes

List of opcodes constants.

SerializedKind
SerializedNativeStructFlag
SerializedNominalResourceFlag
SerializedType

Constants for signature blob values.

SignatureType

Constants for signature kinds (type, function, locals). Those values start a signature blob.

TableType

Constants for table types in the binary.

Constants

BINARY_SIZE_LIMIT

Upper limit on the binary size

Functions

read_uleb128_as_u16

Reads a u16 in ULEB128 format from a binary.

read_uleb128_as_u32

Reads a u32 in ULEB128 format from a binary.

write_u16

Write a u16 in Little Endian format.

write_u32

Write a u32 in Little Endian format.

write_u64

Write a u64 in Little Endian format.

write_u16_as_uleb128

Take a Vec<u8> and a value to write to that vector and applies LEB128 logic to compress the u16.

write_u32_as_uleb128

Take a Vec<u8> and a value to write to that vector and applies LEB128 logic to compress the u32.