instance

package
v0.6.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExportNotFound = errors.New("the requested export is not found in the module")

Functions

func Remove

func Remove(ident int32)

func Store

func Store(inst *Instance) (int32, error)

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func ForIdentifier

func ForIdentifier(ident int32, needsFFIResult bool) (*Instance, error)

func New

func New(inst *wasmtime.Instance, store *wasmtime.Store) *Instance

New creates a new Instance wrapper

func (*Instance) Call

func (w *Instance) Call(fn string, args ...interface{}) (interface{}, error)

func (*Instance) Close

func (w *Instance) Close()

func (*Instance) Ctx

func (w *Instance) Ctx() *scheduler.Ctx

Ctx returns the internal Ctx

func (*Instance) Deallocate

func (w *Instance) Deallocate(pointer int32, length int)

Deallocate deallocates memory in the instance

func (*Instance) ExecutionResult

func (w *Instance) ExecutionResult() ([]byte, error)

ExecutionResult gets the module's execution results

func (*Instance) ReadMemory

func (w *Instance) ReadMemory(pointer int32, size int32) []byte

ReadMemory reads memory from the instance

func (*Instance) SendExecutionResult

func (w *Instance) SendExecutionResult(result []byte, runErr error)

SendExecutionResult allows FFI functions to send the run result

func (*Instance) UseCtx

func (w *Instance) UseCtx(ctx *scheduler.Ctx)

UseCtx sets the internal Ctx

func (*Instance) WriteMemory

func (w *Instance) WriteMemory(data []byte) (int32, error)

WriteMemory writes memory into the instance

func (*Instance) WriteMemoryAtLocation

func (w *Instance) WriteMemoryAtLocation(pointer int32, data []byte)

WriteMemoryAtLocation writes memory at the given location

Jump to

Keyboard shortcuts

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