Module checked

Source
Expand description

Definitions for checked, safe variants of methods defined on Store and Linker.

This module defines extensions in the form of new types and new methods. It only relies on the fact that the Store and the Linker both store a StoreId. No other changes are required to be made to the main interpreter for this checked API.

All extension methods defined in this module use special stored objects. These objects are essentially normal objects like FuncAddr, RunState or Value. However, they also contain an additional field of type StoreId as a tag to know to which Store they belong to.

While this is easy for address types like FuncAddr or MemAddr, some types are enums and their variants are visible to the user. For example, consider the Value enum, where users have full access to all of its variants. To be able to attach a tag only to the Value::Ref variant of this enum, the entire enum has to be re-defined. The result is a completely new type StoredValue.

Structs§

Stored
A generic stored wrapper. This is used to wrap struct types such as FuncAddr, MemAddr, etc.
StoredInstantiationOutcome
A stored variant of InstantiationOutcome
StoredRefFunc

Enums§

StoredExternVal
A stored variant of ExternVal
StoredRef
A stored variant of Ref
StoredRunState
A stored variant of RunState
StoredValue
A stored variant of Value

Traits§

StoredInteropValue
A stored variant of InteropValue
StoredInteropValueList
A StoredInteropValueList is an iterable list of StoredInteropValues (i.e. Rust types that can be converted into Wasm StoredValues).