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
.
Modules§
- The entity module, with common helpers for Rust structures
- The
lib
module defines astd
module that is identical whether thecore
or thestd
feature is enabled. - Partial sum maps
Macros§
- Macro which provides the common implementation of a 32-bit entity reference.
Structs§
- See
IndexMap
- Atomically.
- Units of WebAssembly memory in terms of 8-bit bytes.
- Index type of a custom section inside a WebAssembly module.
- Index type of a passive data segment inside the WebAssembly module.
- A data initializer for linear memory.
- A memory index and offset within that memory where a data initialization should be performed.
- Index type of a passive element segment inside the WebAssembly module.
- A descriptor for an exported WebAssembly value.
- An opaque reference to some data. This reference can be passed through Wasm.
- Fast gas counter with very simple structure, could be exposed to compiled code in the VM. For instance by intrinsifying host functions responsible for gas metering.
- Controls which experimental features will be enabled. Features usually have a corresponding WebAssembly proposal.
- Index type of a function (imported or local) inside the WebAssembly module.
- The signature of a function that is either implemented in a Wasm module or exposed to Wasm by the host.
- Borrowed version of
FunctionType
. - Index type of a global variable (imported or local) inside the WebAssembly module.
- WebAssembly global.
- A descriptor for an imported value into a wasm module.
- The counts of imported entities in a WebAssembly module.
- External configuration of execution environment for Instance.
- Index type of a function defined locally inside the WebAssembly module.
- Index type of a global defined locally inside the WebAssembly module.
- Index type of a memory defined locally inside the WebAssembly module.
- Index type of a table defined locally inside the WebAssembly module.
- Index type of a linear memory (imported or local) inside the WebAssembly module.
- A descriptor for a WebAssembly memory type.
- A view into a memory.
- A translated WebAssembly module, excluding the function bodies and memory initializers.
- As
DataInitializer
but owning the data rather than holding a reference to it - A WebAssembly table initializer.
- The only error that can happen when converting
Bytes
toPages
- Units of WebAssembly pages (as specified to be 65,536 bytes).
- Index type of a signature (imported or local) inside the WebAssembly module.
- Index type of a table (imported or local) inside the WebAssembly module.
- A descriptor for a table in a WebAssembly module.
- The WebAssembly V128 type
- This type does not do reference counting automatically, reference counting can be done with
Self::ref_clone
andSelf::ref_drop
.
Enums§
- An entity to export.
- A list of all possible types which can be externally referenced from a WebAssembly module.
- Globals are initialized via the
const
operators or by referring to another import. - An entity to import.
- Indicator of whether a global is mutable or not
- A list of all possible value types in WebAssembly.
- Possible runtime values that a WebAssembly module can either consume or produce.
Constants§
- Version number of this crate.
- The number of pages we can have before we run out of byte index space.
- The minimum number of pages allowed.
- WebAssembly page sizes are fixed to be 64KiB. Note: large page support may be added in an opt-in manner in the future.
Traits§
NativeWasmType
represents a Wasm type that has a direct representation on the host (hence the “native” term).- Trait for a Value type. A Value type is a type that is always valid and may be safely copied.
- Trait for reading and writing Wasm values into binary for use on the layer between the API and the VM internals, specifically with
near_vm_types::Value
.