MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / code

Method code

crates/c-api/include/wasmtime/trap.hh:143–149  ·  view source on GitHub ↗

\brief Returns the trap code associated with this trap, or nothing if it was a manually created trap.

Source from the content-addressed store, hash-verified

141 /// \brief Returns the trap code associated with this trap, or nothing if
142 /// it was a manually created trap.
143 std::optional<wasmtime_trap_code_t> code() const {
144 wasmtime_trap_code_t code;
145 bool present = wasmtime_trap_code(ptr.get(), &code);
146 if (present)
147 return code;
148 return std::nullopt;
149 }
150};
151
152/// Structure used to represent either a `Trap` or an `Error`.

Callers 5

run_testsFunction · 0.45
discover_test_binariesFunction · 0.45
eqMethod · 0.45
assert_trap_codeFunction · 0.45
TESTFunction · 0.45

Calls 2

wasmtime_trap_codeFunction · 0.85
getMethod · 0.45

Tested by 2

assert_trap_codeFunction · 0.36
TESTFunction · 0.36