[][src]Crate wasmer

Wasmer API

Re-exports

pub use wasmer_compiler::wasmparser;

Modules

internals

We use the internals module for exporting types that are only intended to use in internal crates such as the compatibility crate wasmer-vm. Please don't use any of this types directly, as they might change frequently or be removed in the future.

Macros

imports

Generate an ImportObject easily with the imports! macro.

Structs

Array

The Array marker type. This type can be used like WasmPtr<T, Array> to get access to methods

Atomically

Atomically.

Bytes

Units of WebAssembly memory in terms of 8-bit bytes.

Cranelift

Global configuration options used to create an [Engine] and customize its behavior.

ExportType

A descriptor for an exported WebAssembly value.

Exports

Exports is a special kind of map that allows easily unwrapping the types of instances.

ExportsIterator

An iterator over exports.

Features

Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.

Function

A WebAssembly function instance.

FunctionType

The signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.

Global

A WebAssembly global instance.

GlobalType

WebAssembly global.

HostRef

Represents a piece of data located in the host environment.

ImportObject

All of the import data used when instantiating.

ImportObjectIterator

Iterator for an ImportObject's exports.

ImportType

A descriptor for an imported value into a wasm module.

Instance

A WebAssembly Instance is a stateful, executable instance of a WebAssembly Module.

Item

The Item marker type. This is the default and does not usually need to be specified.

JIT

The JIT builder

JITArtifact

A compiled wasm module, ready to be instantiated.

JITEngine

A WebAssembly JIT Engine.

LocalFunctionIndex

Index type of a function defined locally inside the WebAssembly module.

Memory

A WebAssembly memory instance.

MemoryType

A descriptor for a WebAssembly memory type.

MemoryView

A view into a memory.

MiddlewareReaderState

The state of the binary reader. Exposed to middlewares to push their outputs.

Module

A WebAssembly Module contains stateless WebAssembly code that has already been compiled and can be instantiated multiple times.

NamedResolverChain

A Resolver that links two resolvers together in a chain.

NativeFunc

A WebAssembly function that can be called natively (using the Native ABI).

Pages

Units of WebAssembly pages (as specified to be 65,536 bytes).

RuntimeError

A struct representing an aborted instruction execution, with a message indicating the cause.

Store

The store represents all global state that can be manipulated by WebAssembly programs. It consists of the runtime representation of all instances of functions, tables, memories, and globals that have been allocated during the lifetime of the abstract machine.

Table

A WebAssembly table instance.

TableType

A descriptor for a table in a WebAssembly module.

Target

This is the target that we will use for compiling the WebAssembly ModuleInfo, and then run it.

Triple

A target "triple". Historically such things had three fields, though they've added additional fields over time.

Tunables

Tunable parameters for WebAssembly compilation.

WasmPtr

A zero-cost type that represents a pointer to something in Wasm linear memory.

Enums

Architecture

The "architecture" field, which in some cases also specifies a specific subarchitecture.

CallingConvention

The calling convention, which specifies things like which registers are used for passing arguments, which registers are callee-saved, and so on.

CpuFeature

The nomenclature is inspired by the cpuid crate. The list of supported features was initially retrieved from cranelift-native.

DeserializeError

The Deserialize error can occur when loading a compiled Module from a binary.

Export

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

ExportError

The ExportError can happen when trying to get a specific export Extern from the Instance exports.

Extern

An Extern is the runtime representation of an entity that can be imported or exported.

ExternRef

Represents an opaque reference to any data within WebAssembly.

ExternType

A list of all possible types which can be externally referenced from a WebAssembly module.

GlobalInit

Globals are initialized via the const operators or by referring to another import.

InstantiationError

An error while instantiating a module.

LinkError

The WebAssembly.LinkError object indicates an error during module instantiation (besides traps from the start function).

MemoryError

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

Mutability

Indicator of whether a global is mutable or not

OperatingSystem

The "operating system" field, which sometimes implies an environment, and sometimes isn't an actual operating system.

SerializeError

The Serialize error can occur when serializing a compiled Module into a binary.

Type

A list of all possible value types in WebAssembly.

ValType

A list of all possible value types in WebAssembly.

Constants

HOST

The Triple of the current host.

VERSION

Version number of this crate.

WASM_MAX_PAGES

The number of pages we can have before we run out of byte index space.

WASM_MIN_PAGES

The minimum number of pages allowed.

WASM_PAGE_SIZE

WebAssembly page sizes are fixed to be 64KiB. Note: large page support may be added in an opt-in manner in the future.

Traits

ChainableNamedResolver

A trait for chaining resolvers together.

CompilerConfig

The compiler configuration options.

Engine

A unimplemented Wasmer Engine.

Exportable

This trait is used to mark types as gettable from an Instance.

FromToNativeWasmType

A trait to convert a Rust value to a WasmNativeType value, or to convert WasmNativeType value to a Rust value.

FunctionMiddleware

A function middleware specialized for a single function.

FunctionMiddlewareGenerator

A shared builder for function middlewares.

HostFunction

The HostFunction trait represents the set of functions that can be used as host function. To uphold this statement, it is necessary for a function to be transformed into a pointer to VMFunctionBody.

HostInfo
LikeNamespace

The LikeNamespace trait represents objects that act as a namespace for imports. For example, an Instance or Namespace could be considered namespaces that could provide imports to an instance.

NamedResolver

Import resolver connects imports with available exported values.

Resolver

Import resolver connects imports with available exported values.

StoreObject

A trait represinting any object that lives in the Store.

ValueType

Trait for a Value type. A Value type is a type that is always valid and may be safely copied.

WasmTypeList

The WasmTypeList trait represents a tuple (list) of Wasm typed values. It is used to get low-level representation of such a tuple.

Functions

is_wasm

Check if the provided bytes are wasm-like

raise_user_trap

Raises a user-defined trap immediately.

wat2wasm

Parses in-memory bytes as either the WebAssembly Text format, or a binary WebAssembly module.

Type Definitions

Val

WebAssembly computations manipulate values of basic value types:

Value

WebAssembly computations manipulate values of basic value types: