\brief Returns the trap code associated with this trap, or nothing if it was a manually created trap.
| 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`. |