Expand description
This are the common types and utility tools for using WebAssembly in a Rust environment.
This crate provides common structures such as Type
or Value
, type indexes
and native function wrappers with Func
.
Re-exports§
pub use error::CompileError;
pub use error::DeserializeError;
pub use error::ImportError;
pub use error::MemoryError;
pub use error::MiddlewareError;
pub use error::ParseCpuFeatureError;
pub use error::PreInstantiationError;
pub use error::SerializeError;
pub use error::WasmError;
pub use error::WasmResult;
Modules§
- entity
- The entity module, with common helpers for Rust structures
- error
- The WebAssembly possible errors
- lib
- The
lib
module defines astd
module that is identical whether thecore
or thestd
feature is enabled. - target
- Target configuration
Macros§
- entity_
impl - Macro which provides the common implementation of a 32-bit entity reference.
Structs§
- Archived
Data Initializer Location - An archived
DataInitializerLocation
- Archived
Owned Data Initializer - An archived
OwnedDataInitializer
- Bytes
- Units of WebAssembly memory in terms of 8-bit bytes.
- Custom
Section Index - Index type of a custom section inside a WebAssembly module.
- Data
Index - Index type of a passive data segment inside the WebAssembly module.
- Data
Initializer - A data initializer for linear memory.
- Data
Initializer Location - A memory index and offset within that memory where a data initialization should be performed.
- Elem
Index - Index type of a passive element segment inside the WebAssembly module.
- Export
Type - A descriptor for an exported WebAssembly value.
- Exports
Iterator - This iterator allows us to iterate over the exports and offer nice API ergonomics over it.
- Features
- Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.
- Frame
Info - Description of a frame in a backtrace.
- Function
Index - Index type of a function (imported or local) inside the WebAssembly module.
- Function
Type - The signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.
- Global
Index - Index type of a global variable (imported or local) inside the WebAssembly module.
- Global
Type - WebAssembly global.
- Import
Key - Hash key of an import
- Import
Type - A descriptor for an imported value into a wasm module.
- Imports
Iterator - This iterator allows us to iterate over the imports and offer nice API ergonomics over it.
- Local
Function Index - Index type of a function defined locally inside the WebAssembly module.
- Local
Global Index - Index type of a global defined locally inside the WebAssembly module.
- Local
Memory Index - Index type of a memory defined locally inside the WebAssembly module.
- Local
Table Index - Index type of a table defined locally inside the WebAssembly module.
- Local
TagIndex - Index type of a tag defined locally inside the WebAssembly module.
- Memory32
- Marker trait for 32-bit memories.
- Memory64
- Marker trait for 64-bit memories.
- Memory
Index - Index type of a linear memory (imported or local) inside the WebAssembly module.
- Memory
Type - A descriptor for a WebAssembly memory type.
- Metadata
Header - Metadata header which holds an ABI version and the length of the remaining metadata.
- Module
Info - A translated WebAssembly module, excluding the function bodies and memory initializers.
- Owned
Data Initializer - As
DataInitializer
but owning the data rather than holding a reference to it - Page
Count OutOf Range - The only error that can happen when converting
Bytes
toPages
- Pages
- Units of WebAssembly pages (as specified to be 65,536 bytes).
- Signature
Index - Index type of a signature (imported or local) inside the WebAssembly module.
- Source
Loc - A source location.
- StoreId
- Unique ID to identify a context.
- Table
Index - Index type of a table (imported or local) inside the WebAssembly module.
- Table
Initializer - A WebAssembly table initializer.
- Table
Type - A descriptor for a table in a WebAssembly module.
- Tag
- WebAssembly event.
- TagIndex
- Index type of an event inside the WebAssembly module.
- TagType
- The signature of a tag that is either implemented in a Wasm module or exposed to Wasm by the host.
- Target
Shared Signature Index - Target specific type for shared signature index.
- Trap
Information - Information about trap.
- V128
- The WebAssembly V128 type
- VMBuiltin
Function Index - An index type for builtin functions.
- VMOffsets
- This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.
Enums§
- Export
Index - An entity to export.
- Extern
Type - A list of all possible types which can be externally referenced from a WebAssembly module.
- Global
Init - Globals are initialized via the
const
operators or by referring to another import. - Hash
Algorithm - Hashing algorithm to be used for the module info
- Import
Index - An entity to import.
- LibCall
- The name of a runtime library routine.
- Memory
Style - Implementation styles for WebAssembly linear memory.
- Module
Hash - The hash of a WebAssembly module.
- Mutability
- Indicator of whether a global is mutable or not
- OnCalled
Action - After the stack is unwound via asyncify what should the call loop do next
- Table
Style - Implementation styles for WebAssembly tables.
- TagKind
- The kind of a [
Tag
]. - Trap
Code - A trap code describing the reason for a trap.
- Type
- A list of all possible value types in WebAssembly.
Constants§
- 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§
- Data
Initializer Like - Any struct that acts like a
DataInitializer
. - Data
Initializer Location Like - Any struct that acts like a
DataInitializerLocation
. - Memory
Size - Trait for the
Memory32
andMemory64
marker types. - Native
Wasm Type NativeWasmType
represents a Wasm type that has a direct representation on the host (hence the “native” term).- Value
Type - Trait for a Value type. A Value type is a type that is always valid and may be safely copied.
Functions§
- is_wasm
- Check if the provided bytes are wasm-like
Type Aliases§
- Addend
- Addend to add to the symbol value.
- Code
Offset - Offset in bytes from the beginning of the function.
Unions§
- RawValue
- Raw representation of a WebAssembly value.