|
Wasmtime
|
A WebAssembly exception object. More...
#include <exn.hh>
Public Member Functions | |
| Exn (wasmtime_exn_t *raw) | |
Takes ownership of a raw wasmtime_exn_t pointer. | |
| Exn (Exn &&other)=default | |
| Constructs a new exception. | |
| Exn & | operator= (Exn &&other)=default |
| Moves an exception. | |
| Exn (const Exn &)=delete | |
| Exn & | operator= (const Exn &)=delete |
| ~Exn ()=default | |
| Destroys an exception. | |
| Result< Tag > | tag (Store::Context cx) const |
| Returns the tag associated with this exception. | |
| size_t | field_count (Store::Context cx) const |
| Returns the number of fields in this exception. | |
| Result< Val > | field (Store::Context cx, size_t index) const |
| Reads a field value by index. | |
| wasmtime_exn_t * | capi () const |
| Returns the raw underlying C API pointer (non-owning). | |
| wasmtime_exn_t * | release () |
| Releases ownership of the underlying C API pointer. | |
Static Public Member Functions | |
| static Result< Exn > | create (Store::Context cx, const Tag &tag, const std::vector< Val > &fields) |
| Create a new exception object. More... | |
A WebAssembly exception object.
Exception objects carry a tag and a set of field values. They are allocated on the GC heap within a store.
This type owns its underlying wasmtime_exn_t handle. When it goes out of scope the handle is freed.
|
inlinestatic |
Create a new exception object.
| cx | the store in which to allocate the exception |
| tag | the tag to associate with this exception |
| fields | the field values matching the tag's payload signature |