7#ifndef WASMTIME_EXNREF_H
8#define WASMTIME_EXNREF_H
12#ifdef WASMTIME_FEATURE_GC
Build-time defines for how the C API was built.
WASM_API_EXTERN wasmtime_error_t * wasmtime_exnref_tag(wasmtime_context_t *store, const wasmtime_exnref_t *exn, wasmtime_tag_t *tag_ret)
Returns the tag associated with this exception.
WASM_API_EXTERN void wasmtime_exnref_from_raw(wasmtime_context_t *context, uint32_t raw, wasmtime_exnref_t *out)
Converts a raw exnref value coming from wasmtime_val_raw_t into a wasmtime_exnref_t.
WASM_API_EXTERN wasm_trap_t * wasmtime_context_set_exception(wasmtime_context_t *store, const wasmtime_exnref_t *exn)
Sets the pending exception on the store and returns a trap.
WASM_API_EXTERN void wasmtime_exnref_clone(const wasmtime_exnref_t *ref, wasmtime_exnref_t *out)
Creates a new reference pointing to the same exception that ref points to.
WASM_API_EXTERN size_t wasmtime_exnref_field_count(wasmtime_context_t *store, const wasmtime_exnref_t *exn)
Returns the number of fields in this exception.
WASM_API_EXTERN uint32_t wasmtime_exnref_to_raw(wasmtime_context_t *context, const wasmtime_exnref_t *ref)
Converts a wasmtime_exnref_t to a raw value suitable for storing into a wasmtime_val_raw_t.
WASM_API_EXTERN wasmtime_error_t * wasmtime_exnref_new(wasmtime_context_t *store, const wasmtime_tag_t *tag, const wasmtime_val_t *fields, size_t nfields, wasmtime_exnref_t *exn_ret)
Creates a new exception object.
WASM_API_EXTERN bool wasmtime_context_has_exception(wasmtime_context_t *store)
Tests whether there is a pending exception on the store.
WASM_API_EXTERN wasmtime_error_t * wasmtime_exnref_field(wasmtime_context_t *store, const wasmtime_exnref_t *exn, size_t index, wasmtime_val_t *val_ret)
Reads a field value from this exception by index.
WASM_API_EXTERN void wasmtime_exnref_unroot(wasmtime_exnref_t *ref)
Unroots the ref provided, enabling future garbage collection.
WASM_API_EXTERN bool wasmtime_context_take_exception(wasmtime_context_t *store, wasmtime_exnref_t *exn_ret)
Takes the pending exception from the store, if any.
Opaque struct representing a wasm trap.
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.
A WebAssembly exception reference value.
Definition: val.h:103
uint64_t store_id
Definition: val.h:106
Representation of a tag in Wasmtime.
Definition: tag.h:28
Container for different kinds of wasm values.
Definition: val.h:376