Crate wasmer_vm[][src]

Expand description

Runtime library support for Wasmer.

Modules

Runtime library calls.

Structs

This iterator allows us to iterate over the exports and offer nice API ergonomics over it.

The registry that holds the values that VMFuncRefs point to.

A safe wrapper around VMFunctionBody.

A Global instance

Resolved import pointers.

This iterator allows us to iterate over the imports and offer nice API ergonomics over it.

This is an intermediate type that manages the raw allocation and metadata when creating an [Instance].

A handle holding an InstanceRef, which holds an Instance of a WebAssembly module.

A linear memory instance.

A table instance.

A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.

A translated WebAssembly module, excluding the function bodies and memory initializers.

Pointers to section data.

WebAssembly requires that the caller and callee signatures in an indirect call must match. To implement this efficiently, keep a registry of all signatures, shared by all instances, so that call sites can just do an index comparison.

Target specific type for shared signature index.

Opaque state used to help control TLS state across stack switches for async support.

An index type for builtin functions.

The VM caller-checked “anyfunc” record, for caller-side signature checking. It consists of the actual function pointer and a signature id to be checked by the caller.

The VM “context”, which is pointed to by the vmctx arg in the compiler. This has information about globals, memories, tables, and other runtime state associated with the current instance.

The VMDynamicFunctionContext is the context that dynamic functions will receive when called (rather than vmctx). A dynamic function is a function for which we don’t know the signature until runtime.

This type does not do reference counting automatically, reference counting can be done with Self::ref_clone and Self::ref_drop.

A function reference. A single word that points to metadata about a function.

A function export value.

A placeholder byte-sized type which is just used to provide some amount of type safety when dealing with pointers to JIT-compiled function bodies. Note that it’s deliberately not Copy, as we shouldn’t be carelessly copying function body bytes around.

An imported function.

A global export value.

The storage for a WebAssembly global defined within the instance.

The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.

A memory export value.

The fields compiled code needs to access to utilize a WebAssembly linear memory defined within the instance, namely the start address and the size in bytes.

The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.

This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.

An index into the shared signature registry, usable for checking signatures at indirect calls.

A table export value.

The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.

The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.

Enums

Error type describing things that can go wrong when operating on Wasm Globals.

A collection of data about host envs used by imported functions.

Error type describing things that can go wrong when operating on Wasm Memories.

Implementation styles for WebAssembly linear memory.

A reference stored in a table. Can be either an externref or a funcref.

Implementation styles for WebAssembly tables.

Stores trace message with backtrace.

A trap code describing the reason for a trap.

The value of an export passed from one instance to another.

A function kind is a calling convention into and out of wasm code.

An InstanceRef that may or may not be keeping the Instance alive.

Constants

Version number of this crate.

Statics

The probestack based on the Rust probestack

Traits

Trait for implementing Wasm Memory used by Wasmer.

Trait for implementing the interface of a Wasm table.

A package of functionality needed by catch_traps to figure out what to do when handling a trap.

Functions

Catches any wasm traps that happen within the execution of closure, returning them as a Result.

Catches any wasm traps that happen within the execution of closure, returning them as a Result, with the closure contents.

This function is required to be called before any WebAssembly is entered. This will configure global state such as signal handlers to prepare the process to receive wasm traps.

Raises a trap from inside library code immediately.

Raises a user-defined trap immediately.

Carries a Rust panic across wasm code and resumes the panic on the other side.

Call the wasm function pointed to by callee.

Type Definitions

The function pointer to call with data and an [Instance] pointer to finish initializing the host env.

Function which may handle custom signals while processing traps.

Unions

Union representing the first parameter passed when calling a function.