Module sophon_wasm::elements [] [src]

Elements of the WebAssembly binary format.

Structs

CodeSection

Section with function bodies of the module.

CountedList

List for reading sequence of elements typed T, given they are preceded by length (serialized as VarUint32)

CountedListWriter

Helper struct to write series of T preceded by the length of the sequence serialized as VarUint32

CountedWriter

Helper struct to write payload which is preceded by it's own length in bytes.

CustomSection

Custom section

DataSection

Data entries definitions.

DataSegment

Data segment definition.

ElementSection

Element entries section.

ElementSegment

Entry in the element section.

ExportEntry

Export entry.

ExportSection

List of exports definition.

Func

Function signature (type reference)

FuncBody

Function body definition.

FunctionSection

Section with function signatures definition.

FunctionType

Function signature type.

GlobalEntry

Global entry in the module.

GlobalSection

Globals definition section.

GlobalType

Global definition struct

ImportEntry

Import entry.

ImportSection

Section of the imports definition.

InitExpr

Initialization expression.

Local

Local definition inside the function body.

MemorySection

Section with table definition (currently only one entry is allowed).

MemoryType

Memory entry.

Module

WebAssembly module

Opcodes

Collection of opcodes (usually inside a block section).

ResizableLimits

Memory limits

TableSection

Section with table definition (currently only one is allowed).

TableType

Table entry

TypeSection

Section with type declarations

Uint32

32-bit unsigned integer, encoded in little endian

Uint64

64-bit unsigned integer, encoded in little endian

Unparsed

Unparsed part of the module/section

VarInt7

7-bit signed integer, encoded in LEB128 (always 1 byte length)

VarInt32

32-bit signed integer, encoded in LEB128 (can be 1-5 bytes length)

VarInt64

64-bit signed integer, encoded in LEB128 (can be 1-9 bytes length)

VarUint1

VarUint1, 1-bit value (0/1)

VarUint7

7-bit unsigned integer, encoded in LEB128 (always 1 byte length)

VarUint32

Unsigned variable-length integer, limited to 32 bits, represented by at most 5 bytes that may contain padding 0x80 bytes.

VarUint64

Unsigned variable-length integer, limited to 64 bits, represented by at most 9 bytes that may contain padding 0x80 bytes.

Enums

BlockType

Block type which is basically ValueType + NoResult (to define blocks that have no return type)

Error

Deserialization/serialization error

External

External to local binding.

Internal

Internal reference of the exported entry.

Opcode

Opcode

Section

Section in the WebAssembly module.

TableElementType

Table element type.

Type

Type definition in types section. Currently can be only of the function type.

ValueType

Value type.

Traits

Deserialize

Deserialization from serial i/o

Serialize

Serialization to serial i/o

Functions

deserialize_buffer

Deserialize deserializable type from buffer.

deserialize_file

Deserialize module from file.

peek_size

Returns size of the module in the provided stream

serialize

Create buffer with serialized value.

serialize_to_file

Serialize module to the file