func Instantiate(ctx context.Context, r wazero.Runtime) (api.Closer, error)
Instantiate instantiates the "env" module used by AssemblyScript into the runtime.
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.
FunctionExporter configures the functions in the "env" module used by AssemblyScript.
type FunctionExporter interface { // WithAbortMessageDisabled configures the AssemblyScript abort function to // discard any message. WithAbortMessageDisabled() FunctionExporter // WithTraceToStdout configures the AssemblyScript trace function to output // messages to Stdout, as configured by wazero.ModuleConfig WithStdout. WithTraceToStdout() FunctionExporter // WithTraceToStderr configures the AssemblyScript trace function to output // messages to Stderr, as configured by wazero.ModuleConfig WithStderr. // // Because of the potential volume of trace messages, it is often more // appropriate to use WithTraceToStdout instead. WithTraceToStderr() FunctionExporter // 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.