|
Wasmtime
|
Helper class for linking modules together with name-based resolution. More...
#include <linker.hh>
Public Member Functions | |
| template<typename F , std::enable_if_t< std::is_invocable_r_v< Result< std::monostate >, F, Store::Context, const FuncType &, Span< Val >, Span< Val > >, bool > = true> | |
| Result< std::monostate > | add_func (std::string_view name, F &&f) |
| Defines a function within this linker instance. | |
| template<typename F , std::enable_if_t< std::is_invocable_r_v< Result< std::monostate >, F, Store::Context, uint32_t >, bool > = true> | |
| Result< std::monostate > | add_resource (std::string_view name, const ResourceType &ty, F &&f) |
| Defines a new resource in this linker with the provided destructor. | |
Helper class for linking modules together with name-based resolution.
This class is used for easily instantiating Modules by defining names into the linker and performing name-based resolution during instantiation. A Linker can also be used to link in WASI functions to instantiate a module.