Documentation ¶
Index ¶
- func NewFunction(runtime *Runtime, instanceWrn sdk.WRN, fn sdk.Function) *function
- func NewGlobal(value interface{}) (*global, error)
- type GuestFunc
- type HostFunc
- type Instance
- func (i *Instance) Call(name string, args ...interface{}) (interface{}, error)
- func (i *Instance) Close() error
- func (i *Instance) Read(mem sdk.Memory) ([]byte, error)
- func (i *Instance) Stderr() string
- func (i *Instance) Stdout() string
- func (i *Instance) WRN() sdk.WRN
- func (i *Instance) Write(addr int32, bytes []byte) (int32, error)
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFunction ¶
NewFunction creates a function for the given sdk.Function.
Types ¶
type GuestFunc ¶
type GuestFunc func(*wasmtime.Caller, []wasmtime.Val) ([]wasmtime.Val, *wasmtime.Trap)
GuestFunc represents a function that can be used with wasmtime.
type HostFunc ¶
type HostFunc func(...wasmtime.Val) (interface{}, error)
HostFunc translates between GuestFunc and sdk.Function.
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance wraps an active Wasmtime instance with a helpful API for interacting with it.
func NewInstance ¶
func NewInstance(rt *Runtime, hostImports runtime.HostImports) (*Instance, error)
func (*Instance) Stderr ¶
Stderr returns the stderr stream for the instance.z
This will be empty if InheritStderr was not set on WasiConfigs.
func (*Instance) Stdout ¶
Stdout returns the stdout stream for the instance.
This will be empty if InheritStdout was not set on WasiConfig.
Click to show internal directories.
Click to hide internal directories.