wasmtime

package
v0.4.8-rc8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxMemorySize = 32 * 1024 * 1024
)

Variables

This section is empty.

Functions

func NewWASMTimeRuntime

func NewWASMTimeRuntime(ctx context.Context, logger types.Logger, code []byte, apis *types.HostAPIRegistry) (out types.AspectRuntime, err error)

func NewWASMTimeValidator

func NewWASMTimeValidator(_ context.Context, logger types.Logger) (types.Validator, error)

func Wrap

func Wrap(api *types.HostAPIRegistry, module types.Module, ns types.NameSpace, method types.MethodName,
	hostFunc *types.HostFuncWithGasRule) (interface{}, error)

Types

type Context

type Context struct {
	context.Context

	// memory *Memory
	Instance *wasmtime.Instance
	Store    *wasmtime.Store
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context, logger types.Logger) *Context

func (*Context) AddEVMGas

func (c *Context) AddEVMGas(gas int64) error

func (*Context) AllocMemory

func (c *Context) AllocMemory(size int32) (int32, error)

func (*Context) ConsumeWASMGas

func (c *Context) ConsumeWASMGas(gas int64) error

func (*Context) Logger

func (c *Context) Logger() types.Logger

func (*Context) ReadMemory

func (c *Context) ReadMemory(ptr int32, size int32) ([]byte, error)

func (*Context) RemainingEVMGas

func (c *Context) RemainingEVMGas() (int64, error)

func (*Context) RemainingWASMGas

func (c *Context) RemainingWASMGas() (int64, error)

func (*Context) Reset

func (c *Context) Reset()

func (*Context) SetWASMGas

func (c *Context) SetWASMGas(gas int64) error

func (*Context) WriteMemory

func (c *Context) WriteMemory(ptr int32, data []byte) error

Jump to

Keyboard shortcuts

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