Crate wasmtime_runtime

source ·
Expand description

Runtime library support for Wasmtime.

Modules

Structs

  • Opaque state used to persist the state of the CallThreadState activations associated with a fiber stack that’s used as part of an async wasm call.
  • A WebAssembly stack trace.
  • Temporary state stored on the stack which is registered in the tls module below for calls into wasm.
  • A unique identifier (within an engine or similar) for a compiled module.
  • An allocator for compiled module IDs.
  • A WebAssembly Coredump
  • A default memory allocator used by Wasmtime
  • A function export value.
  • A global export value.
  • A memory export value.
  • A table export value.
  • A stack frame within a Wasm stack trace.
  • Registeration for JIT image
  • Resolved import pointers.
  • A type that roughly corresponds to a WebAssembly instance, but is also used for host-defined objects.
  • Represents a request for a new runtime instance.
  • A handle holding an Instance of a WebAssembly module.
  • Representation of a runtime wasm linear memory.
  • One backing image for one memory.
  • Slot management of a copy-on-write image which can be reused for the pooling allocator.
  • A simple struct consisting of a page-aligned pointer to page-aligned and initially-zeroed memory and a length.
  • A type akin to Vec<u8>, but backed by mmap and able to be split.
  • Backing images for memories in a module.
  • Represents the on-demand instance allocator.
  • Opaque state used to help control TLS state across stack switches for async support.
  • A helper type in Wasmtime to store a raw pointer to T while automatically inferring the Send and Sync traits for the container based on the properties of T.
  • 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 internal length slot.”
  • A Box<T> lookalike for memory that’s stored in a Store<T>
  • 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.
  • Stores trace message with backtrace.
  • The VM*Context for array-call host functions.
  • The VM “context”, which is pointed to by the vmctx arg in Cranelift. This has information about globals, memories, tables, and other runtime state associated with the current instance.
  • An external reference to some opaque data.
  • A table that over-approximizes the set of VMExternRefs that any Wasm activation on this thread is currently using.
  • The VM caller-checked “funcref” record, for caller-side signature checking.
  • 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.
  • 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.
  • The storage for a WebAssembly invocation argument
  • 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.
  • A function pointer that exposes the native calling convention.
  • The VM*Context for native-call host functions.
  • An “opaque” version of VMContext which must be explicitly casted to a target context.
  • Structure used to control interrupting wasm code.
  • An index into the shared signature registry, usable for checking signatures at indirect calls.
  • 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.
  • A function pointer that exposes the Wasm calling convention.
  • Description about a fault that occurred in WebAssembly.

Enums

Constants

  • Version number of this crate.

Traits

  • Represents a runtime instance allocator.
  • Used by the runtime to query module information.
  • Used by the runtime to lookup information about a module given a program counter value.
  • Functionality required by this crate for a particular module. This is chiefly needed for lazy initialization of various bits of instance state.
  • A linear memory
  • A memory allocator
  • Dynamic runtime functionality needed by this crate throughout the execution of a wasm instance.

Functions

  • Catches any wasm traps that happen within the execution of closure, returning them as a Result.
  • gc
    Perform garbage collection of VMExternRefs.
  • 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.
  • Returns the host OS page size, in bytes.
  • Raises a trap from inside library code immediately.
  • Raises a trap immediately.
  • Raises a user-defined trap immediately.
  • Carries a Rust panic across wasm code and resumes the panic on the other side.
  • Eagerly initialize thread-local runtime functionality. This will be performed lazily by the runtime if users do not perform it eagerly.

Type Aliases

Unions

  • A “raw” and unsafe representation of a WebAssembly value.