instance

package
v0.0.0-...-c1d2b53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNativeInstance

func NewNativeInstance() nativeModule

Types

type Function

type Function interface {
	Type() binary.FuncType
	Call(args ...WasmVal) ([]WasmVal, error)
}

type Global

type Global interface {
	Type() binary.GlobalType
	GetAsU64() uint64
	SetAsU64(val uint64)
	Get() WasmVal
	Set(val WasmVal)
}

type GoFunc

type GoFunc = func(args []WasmVal) ([]WasmVal, error)

type Map

type Map = map[string]Module

type Memory

type Memory interface {
	Type() binary.MemType
	Size() uint32 // page count
	Grow(n uint32) uint32
	Read(offset uint64, buf []byte)
	Write(offset uint64, buf []byte)
}

type Module

type Module interface {
	GetMember(name string) interface{}
	InvokeFunc(name string, args ...WasmVal) ([]WasmVal, error)
	GetGlobalVal(name string) (WasmVal, error)
	SetGlobalVal(name string, val WasmVal) error
}

type Table

type Table interface {
	Type() binary.TableType
	Size() uint32
	Grow(n uint32)
	GetElem(idx uint32) Function
	SetElem(idx uint32, elem Function)
}

type WasmVal

type WasmVal = interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL