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.
Re-exportsยง
Modulesยง
Structsยง
- Stored
- A generic stored wrapper. This is used to wrap
structtypes such asFuncAddr,MemAddr, etc. - Stored
Instantiation Outcome - A stored variant of
InstantiationOutcome
Enumsยง
- Stored
Extern Val - A stored variant of
ExternVal - Stored
RunState - A stored variant of
RunState
Traitsยง
- Abstract
Stored ๐ - A trait for types that might have a
StoreIdattached to them, so-called stored types.
Functionsยง
- try_
unwrap_ ๐values - Helper method for checking if all
Values in a slice have the givenStoreIdand then, if the check was true, converting them to aVec<Value>. - wrap_
vec_ ๐ โelements - Helper method for associating every element in a
Vecwith aStoreId.