Versions in this module Expand all Collapse all v25 v25.0.0 Sep 20, 2024 Changes in this version + func ModuleValidate(engine *Engine, wasm []byte) error + func Wat2Wasm(wat string) ([]byte, error) + type AsExtern interface + AsExtern func() C.wasmtime_extern_t + type AsExternType interface + AsExternType func() *ExternType + type Caller struct + func (c *Caller) Context() *C.wasmtime_context_t + func (c *Caller) GetExport(name string) *Extern + type Config struct + func NewConfig() *Config + func (cfg *Config) CacheConfigLoad(path string) error + func (cfg *Config) CacheConfigLoadDefault() error + func (cfg *Config) Close() + func (cfg *Config) EnableCraneliftFlag(flag string) + func (cfg *Config) SetConsumeFuel(enabled bool) + func (cfg *Config) SetCraneliftDebugVerifier(enabled bool) + func (cfg *Config) SetCraneliftFlag(name string, value string) + func (cfg *Config) SetCraneliftOptLevel(level OptLevel) + func (cfg *Config) SetDebugInfo(enabled bool) + func (cfg *Config) SetEpochInterruption(enable bool) + func (cfg *Config) SetMaxWasmStack(size int) + func (cfg *Config) SetProfiler(profiler ProfilingStrategy) + func (cfg *Config) SetStrategy(strat Strategy) + func (cfg *Config) SetTarget(target string) error + func (cfg *Config) SetWasmBulkMemory(enabled bool) + func (cfg *Config) SetWasmMemory64(enabled bool) + func (cfg *Config) SetWasmMultiMemory(enabled bool) + func (cfg *Config) SetWasmMultiValue(enabled bool) + func (cfg *Config) SetWasmReferenceTypes(enabled bool) + func (cfg *Config) SetWasmRelaxedSIMD(enabled bool) + func (cfg *Config) SetWasmRelaxedSIMDDeterministic(enabled bool) + func (cfg *Config) SetWasmSIMD(enabled bool) + func (cfg *Config) SetWasmThreads(enabled bool) + type Engine struct + func NewEngine() *Engine + func NewEngineWithConfig(config *Config) *Engine + func (engine *Engine) Close() + func (engine *Engine) IncrementEpoch() + type Error struct + func (e *Error) Close() + func (e *Error) Error() string + func (e *Error) ExitStatus() (int32, bool) + type ExportType struct + func NewExportType(name string, ty AsExternType) *ExportType + func (ty *ExportType) Close() + func (ty *ExportType) Name() string + func (ty *ExportType) Type() *ExternType + type Extern struct + func (e *Extern) AsExtern() C.wasmtime_extern_t + func (e *Extern) Close() + func (e *Extern) Func() *Func + func (e *Extern) Global() *Global + func (e *Extern) Memory() *Memory + func (e *Extern) Table() *Table + func (e *Extern) Type(store Storelike) *ExternType + type ExternType struct + func (ty *ExternType) AsExternType() *ExternType + func (ty *ExternType) Close() + func (ty *ExternType) FuncType() *FuncType + func (ty *ExternType) GlobalType() *GlobalType + func (ty *ExternType) MemoryType() *MemoryType + func (ty *ExternType) TableType() *TableType + type Frame struct + func (f *Frame) FuncIndex() uint32 + func (f *Frame) FuncName() *string + func (f *Frame) FuncOffset() uint + func (f *Frame) ModuleName() *string + func (f *Frame) ModuleOffset() uint + type Func struct + func NewFunc(store Storelike, ty *FuncType, f func(*Caller, []Val) ([]Val, *Trap)) *Func + func WrapFunc(store Storelike, f interface{}) *Func + func (f *Func) AsExtern() C.wasmtime_extern_t + func (f *Func) Call(store Storelike, args ...interface{}) (interface{}, error) + func (f *Func) Type(store Storelike) *FuncType + type FuncType struct + func NewFuncType(params, results []*ValType) *FuncType + func (ty *FuncType) AsExternType() *ExternType + func (ty *FuncType) Close() + func (ty *FuncType) Params() []*ValType + func (ty *FuncType) Results() []*ValType + type Global struct + func NewGlobal(store Storelike, ty *GlobalType, val Val) (*Global, error) + func (g *Global) AsExtern() C.wasmtime_extern_t + func (g *Global) Get(store Storelike) Val + func (g *Global) Set(store Storelike, val Val) error + func (g *Global) Type(store Storelike) *GlobalType + type GlobalType struct + func NewGlobalType(content *ValType, mutable bool) *GlobalType + func (ty *GlobalType) AsExternType() *ExternType + func (ty *GlobalType) Close() + func (ty *GlobalType) Content() *ValType + func (ty *GlobalType) Mutable() bool + type ImportType struct + func NewImportType(module, name string, ty AsExternType) *ImportType + func (ty *ImportType) Close() + func (ty *ImportType) Module() string + func (ty *ImportType) Name() *string + func (ty *ImportType) Type() *ExternType + type Instance struct + func NewInstance(store Storelike, module *Module, imports []AsExtern) (*Instance, error) + func (i *Instance) GetExport(store Storelike, name string) *Extern + func (i *Instance) GetFunc(store Storelike, name string) *Func + func (instance *Instance) Exports(store Storelike) []*Extern + type Linker struct + Engine *Engine + func NewLinker(engine *Engine) *Linker + func (l *Linker) AllowShadowing(allow bool) + func (l *Linker) Close() + func (l *Linker) Define(store Storelike, module, name string, item AsExtern) error + func (l *Linker) DefineFunc(store Storelike, module, name string, f interface{}) error + func (l *Linker) DefineInstance(store Storelike, module string, instance *Instance) error + func (l *Linker) DefineModule(store Storelike, name string, module *Module) error + func (l *Linker) DefineWasi() error + func (l *Linker) FuncNew(module, name string, ty *FuncType, f func(*Caller, []Val) ([]Val, *Trap)) error + func (l *Linker) FuncWrap(module, name string, f interface{}) error + func (l *Linker) Get(store Storelike, module, name string) *Extern + func (l *Linker) GetDefault(store Storelike, name string) (*Func, error) + func (l *Linker) Instantiate(store Storelike, module *Module) (*Instance, error) + type Memory struct + func NewMemory(store Storelike, ty *MemoryType) (*Memory, error) + func (mem *Memory) AsExtern() C.wasmtime_extern_t + func (mem *Memory) Data(store Storelike) unsafe.Pointer + func (mem *Memory) DataSize(store Storelike) uintptr + func (mem *Memory) Grow(store Storelike, delta uint64) (uint64, error) + func (mem *Memory) Size(store Storelike) uint64 + func (mem *Memory) Type(store Storelike) *MemoryType + func (mem *Memory) UnsafeData(store Storelike) []byte + type MemoryType struct + func NewMemoryType(min uint32, has_max bool, max uint32) *MemoryType + func NewMemoryType64(min uint64, has_max bool, max uint64) *MemoryType + func (ty *MemoryType) AsExternType() *ExternType + func (ty *MemoryType) Close() + func (ty *MemoryType) Is64() bool + func (ty *MemoryType) Maximum() (bool, uint64) + func (ty *MemoryType) Minimum() uint64 + type Module struct + func NewModule(engine *Engine, wasm []byte) (*Module, error) + func NewModuleDeserialize(engine *Engine, encoded []byte) (*Module, error) + func NewModuleDeserializeFile(engine *Engine, path string) (*Module, error) + func NewModuleFromFile(engine *Engine, file string) (*Module, error) + func (m *Module) Close() + func (m *Module) Exports() []*ExportType + func (m *Module) Imports() []*ImportType + func (m *Module) Serialize() ([]byte, error) + type OptLevel C.wasmtime_opt_level_t + const OptLevelNone + const OptLevelSpeed + const OptLevelSpeedAndSize + type ProfilingStrategy C.wasmtime_profiling_strategy_t + const ProfilingStrategyJitdump + const ProfilingStrategyNone + type Store struct + Engine *Engine + func NewStore(engine *Engine) *Store + func (store *Store) Close() + func (store *Store) Context() *C.wasmtime_context_t + func (store *Store) GC() + func (store *Store) GetFuel() (uint64, error) + func (store *Store) Limiter(memorySize int64, tableElements int64, instances int64, tables int64, ...) + func (store *Store) SetEpochDeadline(deadline uint64) + func (store *Store) SetFuel(fuel uint64) error + func (store *Store) SetWasi(wasi *WasiConfig) + type Storelike interface + Context func() *C.wasmtime_context_t + type Strategy C.wasmtime_strategy_t + const StrategyAuto + const StrategyCranelift + type Table struct + func NewTable(store Storelike, ty *TableType, init Val) (*Table, error) + func (t *Table) AsExtern() C.wasmtime_extern_t + func (t *Table) Get(store Storelike, idx uint32) (Val, error) + func (t *Table) Grow(store Storelike, delta uint32, init Val) (uint32, error) + func (t *Table) Set(store Storelike, idx uint32, val Val) error + func (t *Table) Size(store Storelike) uint32 + func (t *Table) Type(store Storelike) *TableType + type TableType struct + func NewTableType(element *ValType, min uint32, has_max bool, max uint32) *TableType + func (ty *TableType) AsExternType() *ExternType + func (ty *TableType) Close() + func (ty *TableType) Element() *ValType + func (ty *TableType) Maximum() (bool, uint32) + func (ty *TableType) Minimum() uint32 + type Trap struct + func NewTrap(message string) *Trap + func (t *Trap) Close() + func (t *Trap) Code() *TrapCode + func (t *Trap) Error() string + func (t *Trap) Frames() []*Frame + func (t *Trap) Message() string + type TrapCode uint8 + const BadConversionToInteger + const BadSignature + const HeapMisaligned + const IndirectCallToNull + const IntegerDivisionByZero + const IntegerOverflow + const Interrupt + const MemoryOutOfBounds + const OutOfFuel + const StackOverflow + const TableOutOfBounds + const UnreachableCodeReached + type Val struct + func ValExternref(val interface{}) Val + func ValF32(val float32) Val + func ValF64(val float64) Val + func ValFuncref(f *Func) Val + func ValI32(val int32) Val + func ValI64(val int64) Val + func (v Val) Externref() interface{} + func (v Val) F32() float32 + func (v Val) F64() float64 + func (v Val) Funcref() *Func + func (v Val) Get() interface{} + func (v Val) I32() int32 + func (v Val) I64() int64 + func (v Val) Kind() ValKind + type ValKind C.wasm_valkind_t + const KindExternref + const KindF32 + const KindF64 + const KindFuncref + const KindI32 + const KindI64 + func (ty ValKind) String() string + type ValType struct + func NewValType(kind ValKind) *ValType + func (t *ValType) Kind() ValKind + func (t *ValType) String() string + func (ty *ValType) Close() + type WasiConfig struct + func NewWasiConfig() *WasiConfig + func (c *WasiConfig) Close() + func (c *WasiConfig) InheritArgv() + func (c *WasiConfig) InheritEnv() + func (c *WasiConfig) InheritStderr() + func (c *WasiConfig) InheritStdin() + func (c *WasiConfig) InheritStdout() + func (c *WasiConfig) PreopenDir(path, guestPath string) error + func (c *WasiConfig) SetArgv(argv []string) + func (c *WasiConfig) SetEnv(keys, values []string) + func (c *WasiConfig) SetStderrFile(path string) error + func (c *WasiConfig) SetStdinFile(path string) error + func (c *WasiConfig) SetStdoutFile(path string) error Other modules containing this package github.com/bytecodealliance/wasmtime-go github.com/bytecodealliance/wasmtime-go/v11 github.com/bytecodealliance/wasmtime-go/v12 github.com/bytecodealliance/wasmtime-go/v13 github.com/bytecodealliance/wasmtime-go/v14 github.com/bytecodealliance/wasmtime-go/v15 github.com/bytecodealliance/wasmtime-go/v16 github.com/bytecodealliance/wasmtime-go/v17 github.com/bytecodealliance/wasmtime-go/v18 github.com/bytecodealliance/wasmtime-go/v19 github.com/bytecodealliance/wasmtime-go/v20 github.com/bytecodealliance/wasmtime-go/v21 github.com/bytecodealliance/wasmtime-go/v22 github.com/bytecodealliance/wasmtime-go/v23 github.com/bytecodealliance/wasmtime-go/v24 github.com/bytecodealliance/wasmtime-go/v3 github.com/bytecodealliance/wasmtime-go/v4 github.com/bytecodealliance/wasmtime-go/v5 github.com/bytecodealliance/wasmtime-go/v6 github.com/bytecodealliance/wasmtime-go/v7 github.com/bytecodealliance/wasmtime-go/v8 github.com/bytecodealliance/wasmtime-go/v9