Expand description
Type definitions for addr types
An addr (short for: address) is a dynamic index only known at runtime into a
store. There are addr types for different index spaces, such as memories,
globals or functions FuncAddr.
§A Note About Accessor Methods on Store Address Spaces
At first, we stored a Vec directly in the Store for
function instances, table instances, etc. However, implementing accessor
methods on the Store causes problems, because either the
entire Store has to be passed as an argument (preventing
partial borrows) or a specific Vec has to be passed as an argument
(exposing Store implementation details through a pretty
unergonomic API).
Because both of these solutions were not sufficient, a choice was made for
newtype wrappers around every address space. This way, partial borrows of
the Store are possible, while providing a nice API, even
if it is just used internally.
Structs§
- AddrVec 🔒
- Data
Addr - An address to a data instance that lives in a specific
Store. - Elem
Addr - An address to an element instance that lives in a specific
Store. - Func
Addr - An address to a function instance that lives in a specific
Store. - Global
Addr - An address to a global instance that lives in a specific
Store. - MemAddr
- An address to a memory instance that lives in a specific
Store. - Module
Addr - An address to a module instance that lives in a specific
Store. - Table
Addr - An address to a table instance that lives in a specific
Store.
Traits§
- Addr 🔒
- A trait for all address types.