Expand description
Internal dependency of the wasmtime crate.
This crate is responsible for defining types and basic runtime structures
used by the wasmtime crate. This additionally defines primitives of
compilation and what compilers are expected to emit.
If you don’t already know what this crate is you probably want to use
wasmtime, not this crate.
Re-exports§
- pub use object;
- pub use wasmparser;
Modules§
- __core
- The Rust Core Library
- component
- Support for the component model in Wasmtime.
- drc
- Layout of Wasm GC objects in the deferred reference-counting collector.
- fact
- Wasmtime’s Fused Adapter Compiler of Trampolines (FACT)
- null
- Layout of Wasm GC objects in the null garbage collector.
- obj
- Utilities for working with object files that operate as Wasmtime’s serialization and intermediate format for compiled modules.
- packed_option 
- Compact representation of Option<T>for types with a reserved value.
- prelude
- Rust module prelude for Wasmtime crates.
Macros§
- entity_impl 
- Macro which provides the common implementation of a 32-bit entity reference.
- foreach_builtin_ component_ function 
- Helper macro, like foreach_transcoder, to iterate over builtins for components unrelated to transcoding.
- foreach_builtin_ function 
- Helper macro to iterate over all builtin functions and their signatures.
- wasm_unsupported 
- Return an Err(WasmError::Unsupported(msg))wheremsgthe string built by callingformat!on the arguments to this macro.
Structs§
- AddressMapSection 
- Builder for the address map section of a wasmtime compilation image.
- BoxedSlice 
- A slice mapping K -> Vallocating dense entity references.
- BuiltinFunction Index 
- An index type for builtin functions.
- CompiledFunction Body 
- The result of compiling a single function body.
- CompiledFunctions Table 
- A table describing the set of functions compiled into an artifact, their locations within the text section, and etc…
- CompiledFunctions Table Builder 
- A builder for a CompiledFunctionsTable.
- CompiledModule Info 
- Secondary in-memory results of module compilation.
- ConfigTunables 
- Optional tunable configuration options used in wasmtime::Config
- ConstExpr 
- A constant expression.
- DataIndex 
- Index type of a passive data segment inside the WebAssembly module.
- DebugInfo Data 
- DefinedFunc Index 
- Index type of a defined function inside the WebAssembly module.
- DefinedGlobal Index 
- Index type of a defined global inside the WebAssembly module.
- DefinedMemory Index 
- Index type of a defined memory inside the WebAssembly module.
- DefinedTable Index 
- Index type of a defined table inside the WebAssembly module.
- DefinedTagIndex 
- Index type of a defined tag inside the WebAssembly module.
- ElemIndex 
- Index type of a passive element segment inside the WebAssembly module.
- EngineInterned RecGroup Index 
- Index type of a canonicalized recursive type group inside the whole engine (as opposed to canonicalized within just a single Wasm module).
- EntityList 
- A small list of entity references allocated from a pool.
- EntitySet 
- A set of Kfor densely indexed entity references.
- FilePos
- A position within an original source file,
- FuncIndex 
- Index type of a function (imported or defined) inside the WebAssembly module.
- FuncKeyIndex 
- The index half of a FuncKey.
- FuncKeyNamespace 
- The namespace half of a FuncKey.
- FuncRefIndex 
- Index into the funcref table within a VMContext for a function.
- FunctionBody Data 
- Contains function data: byte code and its offset in the module.
- FunctionLoc 
- Description of where a function is located in the text section of a compiled image.
- FunctionMetadata 
- FunctionName 
- The name of a function stored in the
ELF_NAME_DATAsection.
- FunctionType 
- Type information about functions in a wasm module.
- GcArrayLayout 
- The layout of a GC-managed array.
- GcStructLayout 
- The layout for a GC-managed struct type or exception type.
- GcStructLayout Field 
- A field in a GcStructLayout.
- Global
- A WebAssembly global.
- GlobalIndex 
- Index type of a global variable (imported or defined) inside the WebAssembly module.
- HostPtr
- Type representing the size of a pointer for the current compilation host
- InstructionAddress Map 
- Single source location to generated address mapping.
- Iter
- Iterate over all keys in order.
- IterEntity Range 
- Iterator type returned by iter_entity_range.
- IterMut
- Iterate over all keys in order.
- Keys
- Iterate over all keys in order.
- Limits
- The size range of resizeable storage associated with Memory types and Table types.
- ListPool 
- A memory pool for storing lists of T.
- Memory
- WebAssembly linear memory.
- MemoryIndex 
- Index type of a linear memory (imported or defined) inside the WebAssembly module.
- MemoryInitializer 
- A WebAssembly linear memory initializer.
- Metadata
- Metadata associated with a compiled ELF artifact.
- Module
- A translated WebAssembly module, excluding the function bodies and memory initializers.
- ModuleEnvironment 
- Object containing the standalone environment information.
- ModuleInterned RecGroup Index 
- Index type of a canonicalized recursive type group inside a WebAssembly module (as opposed to canonicalized within the whole engine).
- ModuleInterned Type Index 
- A canonicalized type index for a type within a single WebAssembly module.
- ModuleTranslation 
- The result of translating via ModuleEnvironment.
- ModuleTypes 
- All types used in a core wasm module.
- ModuleTypes Builder 
- A builder for ModuleTypes.
- NameSection 
- ObjectBuilder 
- Helper structure to create an ELF file as a compilation artifact.
- OwnedMemory Index 
- Index type of a defined memory inside the WebAssembly module.
- PrimaryMap 
- A primary mapping K -> Vallocating dense entity references.
- RecGroupRelative Type Index 
- A canonicalized type index referencing a type within a single recursion group from another type within that same recursion group.
- ScopeVec 
- Small data structure to help extend the lifetime of a slice to a higher scope.
- SecondaryMap 
- A mapping K -> Vfor densely indexed entity references.
- SetIter
- An iterator over the elements in an EntitySet.
- Setting
- Description of compiler settings returned by CompilerBuilder::settings.
- SizeOverflow 
- SparseMap 
- A sparse mapping of entity references.
- StackMap 
- A map for determining where live GC references live in a stack frame.
- StackMapSection 
- Builder for the ELF_WASMTIME_STACK_MAPsection in compiled executables.
- StaticMemory Initializer 
- Similar to the above MemoryInitializerbut only used when memory initializers are statically known to be valid.
- StaticModule Index 
- Index into the global list of modules found within an entire component.
- Table
- WebAssembly table.
- TableIndex 
- Index type of a table (imported or defined) inside the WebAssembly module.
- TableInitialization 
- Table initialization data for all tables in the module.
- TableSegment 
- A WebAssembly table initializer segment.
- Tag
- WebAssembly exception and control tag.
- TagIndex
- Index type of an event inside the WebAssembly module.
- TrapEncoding Builder 
- A helper structure to build the custom-encoded section of a wasmtime compilation image which encodes trap information.
- TrapInformation 
- Information about trap.
- Tunables
- Tunable parameters for WebAssembly compilation.
- TypeIndex 
- Index type of a type (imported or defined) inside the WebAssembly module.
- VMOffsets
- This class computes offsets to fields within VMContextand other related structs that JIT code accesses directly.
- VMOffsetsFields 
- Used to construct a VMOffsets
- VMSharedType Index 
- A canonicalized type index into an engine’s shared type registry.
- WasmArray Type 
- A concrete array type.
- WasmComposite Type 
- WasmCont Type 
- WebAssembly continuation type – equivalent of wasmparser’s ContType.
- WasmExnType 
- WebAssembly exception type.
- WasmField Type 
- The type of a struct field or array element.
- WasmFile Info 
- WasmFunc Type 
- WebAssembly function type – equivalent of wasmparser’s FuncType.
- WasmRecGroup 
- A recursive type group.
- WasmRefType 
- WebAssembly reference type – equivalent of wasmparser’s RefType
- WasmStruct Type 
- A concrete struct type.
- WasmSubType 
- A concrete, user-defined (or host-defined) Wasm type.
- WasmparserType Converter 
- A convert from wasmparsertypes to Wasmtime types.
Enums§
- Abi
- ABI signature of functions that are generated here.
- Collector
- The garbage collector implementation to use.
- CompileError 
- An error while compiling WebAssembly to machine code.
- ConstOp
- The subset of Wasm opcodes that are constant.
- EngineOrModule Type Index 
- An interned type index, either at the module or engine level.
- EntityIndex 
- An index of an entity.
- EntityType 
- A type of an item in a wasm module where an item is typically something that can be exported.
- FlagValue 
- Value of a configured setting for a Compiler
- FuncKey
- A sortable, comparable function key for compilation output, call graph edges, and relocations.
- FuncKeyKind 
- The kind of a function that is being compiled, linked, or otherwise referenced.
- GcLayout
- The layout of a GC-managed object.
- HostCall 
- Enumeration of all possible ways that wasm may execute code in the host.
- IndexType 
- The type that can be used to index into Memory and Table.
- Initializer
- Initialization routines for creating an instance, encompassing imports, modules, instances, aliases, etc.
- IntraModule Inlining 
- Whether to inline function calls within the same module.
- MemoryInitialization 
- The type of WebAssembly linear memory initialization to use for a module.
- ObjectKind 
- Types of objects that can be created by Compiler::object
- SettingKind 
- Different kinds of Settingvalues that can be configured in aCompilerBuilder
- TableInitial Value 
- Initial value for all elements in a table.
- TableSegment Elements 
- Elements of a table segment, either a list of functions or list of arbitrary expressions.
- Trap
- TrapSentinel 
- Return value of BuiltinFunctionIndex::trap_sentinel.
- VMGcKind 
- The kind of an object in a GC heap.
- WasmComposite Inner Type 
- A function, array, or struct type.
- WasmError 
- A WebAssembly translation error.
- WasmHeap Bottom Type 
- A bottom heap type.
- WasmHeap TopType 
- A top heap type.
- WasmHeap Type 
- WebAssembly heap type – equivalent of wasmparser’s HeapType
- WasmStorage Type 
- Represents storage types introduced in the GC spec for array and struct fields.
- WasmValType 
- WebAssembly value type – equivalent of wasmparser::ValType.
Constants§
- CONTROL_EFFECT_ RESUME_ DISCRIMINANT 
- Discriminant of variant Resumeinruntime::vm::ControlEffect.
- CONTROL_EFFECT_ RETURN_ DISCRIMINANT 
- Discriminant of variant Returninruntime::vm::ControlEffect.
- CONTROL_EFFECT_ SUSPEND_ DISCRIMINANT 
- Discriminant of variant Suspendinruntime::vm::ControlEffect.
- CONTROL_EFFECT_ SWITCH_ DISCRIMINANT 
- Discriminant of variant Switchinruntime::vm::ControlEffect.
- FUNCREF_INIT_ BIT 
- An “initialized bit” in a funcref table.
- FUNCREF_MASK 
- The mask we apply to all refs loaded from funcref tables.
- I31_DISCRIMINANT 
- Discriminant to check whether GC reference is an i31refor not.
- STACK_CHAIN_ ABSENT_ DISCRIMINANT 
- Discriminant of variant Absentinwasmtime::runtime::vm::VMStackChain.
- STACK_CHAIN_ CONTINUATION_ DISCRIMINANT 
- Discriminant of variant Continiationinwasmtime::runtime::vm::VMStackChain.
- STACK_CHAIN_ INITIAL_ STACK_ DISCRIMINANT 
- Discriminant of variant InitialStackinwasmtime::runtime::vm::VMStackChain.
- STACK_STATE_ FRESH_ DISCRIMINANT 
- Discriminant of variant Freshinruntime::vm::VMStackState.
- STACK_STATE_ PARENT_ DISCRIMINANT 
- Discriminant of variant Parentinruntime::vm::VMStackState.
- STACK_STATE_ RETURNED_ DISCRIMINANT 
- Discriminant of variant Returnedinruntime::vm::VMStackState.
- STACK_STATE_ RUNNING_ DISCRIMINANT 
- Discriminant of variant Runninginruntime::vm::VMStackState.
- STACK_STATE_ SUSPENDED_ DISCRIMINANT 
- Discriminant of variant Suspendedinruntime::vm::VMStackState.
- VERSION
- Version number of this crate.
- VMCONTEXT_MAGIC 
- Magic value for core Wasm VM contexts.
- VM_ARRAY_ CALL_ HOST_ FUNC_ MAGIC 
- Equivalent of VMCONTEXT_MAGICexcept for array-call host functions.
- VM_GC_ HEADER_ ALIGN 
- The minimum alignment of the VMGcHeaderin bytes.
- VM_GC_ HEADER_ KIND_ OFFSET 
- The offset of the VMGcKindfield in theVMGcHeader.
- VM_GC_ HEADER_ SIZE 
- The size of the VMGcHeaderin bytes.
- VM_GC_ HEADER_ TYPE_ INDEX_ OFFSET 
- The offset of the VMSharedTypeIndexfield in theVMGcHeader.
- VM_GC_ KIND_ SIZE 
- The size of the VMGcKindin bytes.
- WASM32_MAX_ SIZE 
- Maximum size, in bytes, of 32-bit memories (4G)
Traits§
- CacheStore 
- Implementation of an incremental compilation’s key/value cache store.
- Compiler
- An implementation of a compiler which can compile WebAssembly functions to machine code and perform other miscellaneous tasks needed by the JIT runtime.
- CompilerBuilder 
- Abstract trait representing the ability to create a Compilerbelow.
- EntityRef 
- A type wrapping a small integer index should implement EntityRefso it can be used as the key of anSecondaryMaporSparseMap.
- FinishedObject 
- A type which can be the result of serializing an object.
- GcTypeLayouts 
- A trait for getting the layout of a Wasm GC struct or array inside a particular collector.
- InitMemory 
- The various callbacks provided here are used to drive the smaller bits of memory initialization.
- InliningCompiler 
- An inlining compiler.
- PtrSize
- Trait used for the ptrrepresentation of the field ofVMOffsets
- SparseMapValue 
- Trait for extracting keys from values stored in a SparseMap.
- TripleExt 
- Extension methods for target_lexicon::Triple.
- TypeConvert 
- Helpers used to convert a wasmparsertype to a type in this crate.
- TypeTrace 
- A trait for things that can trace all type-to-type edges, aka all type indices within this thing.
Functions§
- byte_size_ of_ wasm_ ty_ in_ gc_ heap 
- Get the byte size of the given Wasm type when it is stored inside the GC heap.
- demangle_function_ name 
- Demangles a single function name into a user-readable form.
- demangle_function_ name_ or_ index 
- Demangles a function name if it’s provided, or returns a unified representation based on the function index otherwise.
- iter_entity_ range 
- Iterate over a Range<E: EntityRef>, yielding a sequence ofEitems.
- iterate_address_ map 
- Iterate over the address map contained in the given address map section.
- iterate_traps 
- Returns an iterator over all of the traps encoded in section, which should have been produced byTrapEncodingBuilder.
- lookup_file_ pos 
- Lookup an offsetwithin an encoded address map section, returning the originalFilePosthat corresponds to the offset, if found.
- lookup_trap_ code 
- Decodes the provided trap information section and attempts to find the trap
code corresponding to the offsetspecified.
Type Aliases§
- Dwarf
- SparseSet 
- A sparse set of entity references.
- WasmResult 
- A convenient alias for a Resultthat usesWasmErroras the error type.