1#ifndef WASMTIME_EQREF_CLASS_HH
2#define WASMTIME_EQREF_CLASS_HH
7#ifdef WASMTIME_FEATURE_GC
9#include <wasmtime/_store_class.hh>
11#include <wasmtime/helpers.hh>
Representation of a WebAssembly anyref value.
Definition: _anyref_class.hh:21
Representation of a WebAssembly eqref value.
Definition: _eqref_class.hh:28
std::optional< ArrayRef > as_array(Store::Context cx) const
Downcast this eqref into an arrayref.
std::optional< uint32_t > i31_get_u(Store::Context cx) const
Definition: _eqref_class.hh:46
std::optional< StructRef > as_struct(Store::Context cx) const
Downcast this eqref into a structref.
bool is_i31(Store::Context cx) const
Returns true if this eqref is an i31ref.
Definition: _eqref_class.hh:40
static EqRef from_i31(Store::Context cx, uint32_t val)
Create an eqref from an i31 value.
Definition: _eqref_class.hh:33
AnyRef to_anyref() const
Upcast this eqref to an anyref.
bool is_array(Store::Context cx) const
Returns true if this eqref is an arrayref.
Definition: _eqref_class.hh:68
bool is_struct(Store::Context cx) const
Returns true if this eqref is a structref.
Definition: _eqref_class.hh:63
std::optional< int32_t > i31_get_s(Store::Context cx) const
Definition: _eqref_class.hh:55
An interior pointer into a Store.
Definition: _store_class.hh:65
const wasmtime_context_t * capi() const
Returns the underlying C API pointer.
Definition: _store_class.hh:183
Build-time defines for how the C API was built.
WASM_API_EXTERN bool wasmtime_eqref_is_struct(wasmtime_context_t *context, const wasmtime_eqref_t *eqref)
Test whether an eqref is a structref.
WASM_API_EXTERN bool wasmtime_eqref_is_array(wasmtime_context_t *context, const wasmtime_eqref_t *eqref)
Test whether an eqref is an arrayref.
WASM_API_EXTERN bool wasmtime_eqref_i31_get_u(wasmtime_context_t *context, const wasmtime_eqref_t *eqref, uint32_t *dst)
Get the eqref's underlying i31ref value, zero extended.
WASM_API_EXTERN bool wasmtime_eqref_i31_get_s(wasmtime_context_t *context, const wasmtime_eqref_t *eqref, int32_t *dst)
Get the eqref's underlying i31ref value, sign extended.
WASM_API_EXTERN bool wasmtime_eqref_is_i31(wasmtime_context_t *context, const wasmtime_eqref_t *eqref)
Test whether this eqref is an i31ref.
WASM_API_EXTERN void wasmtime_eqref_from_i31(wasmtime_context_t *context, uint32_t i31val, wasmtime_eqref_t *out)
Create a new i31ref value.
A WebAssembly eqref value.
Definition: val.h:163