func Instantiate(ctx context.Context, r wazero.Runtime) (api.Closer, error)
Instantiate instantiates the "env" module used by Emscripten into the runtime.
Deprecated: Due to Emscripten dynamic import generation, InstantiateForModule should be used instead.
func InstantiateForModule(ctx context.Context, r wazero.Runtime, guest wazero.CompiledModule) (api.Closer, error)
InstantiateForModule instantiates a module named "env" populated with any known functions used in emscripten.
func MustInstantiate(ctx context.Context, r wazero.Runtime)
MustInstantiate calls Instantiate or panics on error.
This is a simpler function for those who know the module "env" is not already instantiated, and don't need to unload it.
Deprecated: Due to Emscripten dynamic import generation, InstantiateForModule should be used instead.
FunctionExporter configures the functions in the "env" module used by Emscripten.
type FunctionExporter interface { // ExportFunctions builds functions to export with a wazero.HostModuleBuilder // named "env". ExportFunctions(wazero.HostModuleBuilder) }
func NewFunctionExporter() FunctionExporter
NewFunctionExporter returns a FunctionExporter object with trace disabled. Deprecated: Due to Emscripten dynamic import generation, NewFunctionExporterForModule should be used instead.
func NewFunctionExporterForModule(guest wazero.CompiledModule) (FunctionExporter, error)
NewFunctionExporterForModule returns a guest-specific FunctionExporter, populated with any known functions used in emscripten.