|
Wasmtime
|
Representation of a WebAssembly eqref value.
More...
#include <_eqref_class.hh>
Public Member Functions | |
| bool | is_i31 (Store::Context cx) const |
Returns true if this eqref is an i31ref. | |
| std::optional< uint32_t > | i31_get_u (Store::Context cx) const |
| std::optional< int32_t > | i31_get_s (Store::Context cx) const |
| bool | is_struct (Store::Context cx) const |
Returns true if this eqref is a structref. | |
| bool | is_array (Store::Context cx) const |
Returns true if this eqref is an arrayref. | |
| AnyRef | to_anyref () const |
Upcast this eqref to an anyref. | |
| std::optional< StructRef > | as_struct (Store::Context cx) const |
Downcast this eqref into a structref. | |
| std::optional< ArrayRef > | as_array (Store::Context cx) const |
Downcast this eqref into an arrayref. | |
Static Public Member Functions | |
| static EqRef | from_i31 (Store::Context cx, uint32_t val) |
Create an eqref from an i31 value. | |
Representation of a WebAssembly eqref value.
An eqref is a reference to a GC object that supports equality testing. Subtypes include structref, arrayref, and i31ref.
Like all GC references, EqRef values are rooted in a Store and must be unrooted (by destruction or move) to allow garbage collection.
|
inline |
Get the i31 value as a signed 32-bit integer. Returns std::nullopt if this eqref is not an i31ref.
|
inline |
Get the i31 value as an unsigned 32-bit integer. Returns std::nullopt if this eqref is not an i31ref.