Expand description
Runtime library support for Wasmtime.
Modules§
- libcalls
- Runtime library calls.
Structs§
- Backtrace
- A WebAssembly stack trace.
- Compiled
Module Id - A unique identifier (within an engine or similar) for a compiled module.
- Compiled
Module IdAllocator - An allocator for compiled module IDs.
- Default
Memory Creator - A default memory allocator used by Wasmtime
- Export
Function - A function export value.
- Export
Global - A global export value.
- Export
Memory - A memory export value.
- Export
Table - A table export value.
- GdbJit
Image Registration - Registeration for JIT image
- Imports
- Resolved import pointers.
- Instance
Allocation Request - Represents a request for a new runtime instance.
- Instance
Handle - A handle holding an
Instanceof a WebAssembly module. - Instance
Limits - Instance-related limit configuration for pooling.
- Memory
- Representation of a runtime wasm linear memory.
- Memory
Image - One backing image for one memory.
- Memory
Image Slot - Slot management of a copy-on-write image which can be reused for the pooling allocator.
- Mmap
- A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
- MmapVec
- A type akin to
Vec<u8>, but backed bymmapand able to be split. - Module
Memory Images - Backing images for memories in a module.
- OnDemand
Instance Allocator - Represents the on-demand instance allocator.
- Pooling
Instance Allocator - Implements the pooling instance allocator.
- Pooling
Instance Allocator Config - Configuration options for the pooling instance allocator supplied at construction.
- Shared
Memory - For shared memory (and only for shared memory), this lock-version restricts
access when growing the memory or checking its size. This is to conform with
the thread proposal: “When
IsSharedArrayBuffer(...)is true, the return value should be the result of an atomic read-modify-write of the new size to the internallengthslot.” - Store
Ptr - A pointer to a Store. This Option<*mut dyn Store> is wrapped in a struct so that the function to create a &mut dyn Store is a method on a member of InstanceAllocationRequest, rather than on a &mut InstanceAllocationRequest itself, because several use-sites require a split mut borrow on the InstanceAllocationRequest.
- TlsRestore
- Opaque state used to help control TLS state across stack switches for async support.
- Trap
- Stores trace message with backtrace.
- VMCaller
Checked Func Ref - 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.
- VMContext
- The VM “context”, which is pointed to by the
vmctxarg in Cranelift. This has information about globals, memories, tables, and other runtime state associated with the current instance. - VMExtern
Ref - An external reference to some opaque data.
- VMExtern
RefActivations Table - A table that over-approximizes the set of
VMExternRefs that any Wasm activation on this thread is currently using. - VMFunction
Body - 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.
- VMFunction
Import - An imported function.
- VMGlobal
Definition - The storage for a WebAssembly global defined within the instance.
- VMGlobal
Import - The fields compiled code needs to access to utilize a WebAssembly global variable imported from another instance.
- VMHost
Func Context - The
VM*Contextfor host functions. - VMInvoke
Argument - The storage for a WebAssembly invocation argument
- VMMemory
Definition - 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.
- VMMemory
Import - The fields compiled code needs to access to utilize a WebAssembly linear memory imported from another instance.
- VMOpaque
Context - An “opaque” version of
VMContextwhich must be explicitly casted to a target context. - VMRuntime
Limits - Structure used to control interrupting wasm code.
- VMShared
Signature Index - An index into the shared signature registry, usable for checking signatures at indirect calls.
- VMTable
Definition - The fields compiled code needs to access to utilize a WebAssembly table defined within the instance.
- VMTable
Import - The fields compiled code needs to access to utilize a WebAssembly table imported from another instance.
- Wasm
Fault - Description about a fault that occurred in WebAssembly.
Enums§
- Export
- The value of an export passed from one instance to another.
- Table
- Represents an instance’s table.
- Table
Element - An element going into or coming out of a table.
- Trap
Reason - Enumeration of different methods of raising a trap.
- Wait
Result - Result of
Memory::atomic_wait32andMemory::atomic_wait64
Constants§
- VERSION
- Version number of this crate.
Traits§
- Instance
Allocator - Represents a runtime instance allocator.
- Module
Info - Used by the runtime to query module information.
- Module
Info Lookup - Used by the runtime to lookup information about a module given a program counter value.
- Module
Runtime Info - Functionality required by this crate for a particular module. This is chiefly needed for lazy initialization of various bits of instance state.
- Runtime
Linear Memory - A linear memory
- Runtime
Memory Creator - A memory allocator
- Store
- Dynamic runtime functionality needed by this crate throughout the execution of a wasm instance.
Functions§
- catch_
traps ⚠ - Catches any wasm traps that happen within the execution of
closure, returning them as aResult. - gc⚠
- Perform garbage collection of
VMExternRefs. - init_
traps - 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.
- page_
size - Returns the host OS page size, in bytes.
- prepare_
host_ ⚠to_ wasm_ trampoline - Given a Wasm function pointer and a
vmctx, prepare thevmctxfor calling into that Wasm function, and return the host-to-Wasm entry trampoline. - raise_
lib_ ⚠trap - Raises a trap from inside library code immediately.
- raise_
user_ ⚠trap - Raises a user-defined trap immediately.
- resume_
panic ⚠ - Carries a Rust panic across wasm code and resumes the panic on the other side.
- tls_
eager_ initialize - Eagerly initialize thread-local runtime functionality. This will be performed lazily by the runtime if users do not perform it eagerly.
Type Aliases§
- Signal
Handler - Function which may handle custom signals while processing traps.
- VMTrampoline
- Type definition of the trampoline used to enter WebAssembly from the host.
Unions§
- ValRaw
- A “raw” and unsafe representation of a WebAssembly value.