[][src]Crate lucet_module

Common types for representing Lucet modules.

These types are used both in lucetc and lucet-runtime, with values serialized in bincode format to the compiled Lucet modules.

Re-exports

pub use crate::error::Error;

Modules

bindings
error
owned

Owned variants of the module data types, useful for serialization and testing.

Macros

lucet_signature

Structs

ExportFunction

ExportFunction describes an exported function - its internal function index and a name that function has been exported under.

FunctionHandle
FunctionIndex

FunctionIndex is an identifier for a function, imported, exported, or external. The space of FunctionIndex is shared for all of these, so FunctionIndex(N) may identify exported function #2, FunctionIndex(N + 1) may identify an internal function, and FunctionIndex(N + 2) may identify an imported function.

FunctionMetadata

Information about the corresponding function.

FunctionPointer

FunctionPointer serves entirely as a safer way to work with function pointers than as raw u64 or usize values. It also avoids the need to write them as fn types, which cannot be freely cast from one to another with as. If you need to call a FunctionPointer, use as_usize() and transmute the resulting usize to a fn type with appropriate signature.

FunctionSpec
GlobalSpec

A WebAssembly global along with its export specification.

HeapSpec

Specifications about the heap of a Lucet module.

ImportFunction

ImportFunction describes an internal function - its internal function index and the name/module pair that function should be found in.

InstanceRuntimeData

This struct describes the handful of fields that Lucet-compiled programs may directly interact with, but are provided through VMContext.

LinearMemorySpec

Specification of the linear memory of a module

Module

Module is the exposed structure that contains all the data backing a Lucet-compiled object.

ModuleData

The metadata (and some data) for a Lucet module.

ModuleFeatures
ModuleSignature
PublicKey

A PublicKey is used to verify signatures.

SerializedModule

SerializedModule is a serialization-friendly form of Module, in that the module_data_* fields here refer to a serialized ModuleData, while tables_* and function_manifest_* refer to the actual tables and function manifest written in the binary.

Signature

A signature for a function in a wasm module.

SparseData

A sparse representation of a Lucet module's initial heap.

TableElement
TrapManifest

A collection of trap sites, typically obtained from a single function (see [FunctionSpec::traps])

TrapSite

Trap information for an address in a compiled function

UniqueSignatureIndex

UniqueSignatureIndex names a signature after collapsing duplicate signatures to a single identifier, whereas SignatureIndex is directly what the original module specifies, and may specify duplicates of types that are structurally equal.

VersionInfo

VersionInfo is information about a Lucet module to allow the Lucet runtime to determine if or how the module can be loaded, if so requested. The information here describes implementation details in runtime support for lucetc-produced modules, and nothing higher level.

Enums

Global

A WebAssembly global is either defined locally, or is defined in relation to a field of another WebAssembly module.

GlobalDef

Definition for a global in this module (not imported).

TrapCode

The type of a WebAssembly trap.

ValueType

Constants

LUCET_MODULE_SYM
MODULE_DATA_SYM

Unions

GlobalValue