MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / Code

Method Code

trap.go:104–113  ·  view source on GitHub ↗

Code returns the code of the `Trap` if it exists, nil otherwise.

()

Source from the content-addressed store, hash-verified

102
103// Code returns the code of the `Trap` if it exists, nil otherwise.
104func (t *Trap) Code() *TrapCode {
105 var code C.uint8_t
106 var ret *TrapCode
107 ok := C.wasmtime_trap_code(t.ptr(), &code)
108 if ok == C._Bool(true) {
109 ret = (*TrapCode)(&code)
110 }
111 runtime.KeepAlive(t)
112 return ret
113}
114
115func (t *Trap) Error() string {
116 return t.Message()

Callers 1

TestTrapFramesFunction · 0.80

Calls 1

ptrMethod · 0.95

Tested by 1

TestTrapFramesFunction · 0.64