Wasmtime
|
Representation of a WebAssembly anyref
value.
More...
#include <val.hh>
Public Member Functions | |
AnyRef (wasmtime_anyref_t val) | |
Creates a new AnyRef directly from its C-API representation. | |
AnyRef | clone (Store::Context cx) |
Creates a new AnyRef which is separately rooted from this one. | |
void | unroot (Store::Context cx) |
const wasmtime_anyref_t * | raw () const |
std::optional< uint32_t > | u31 (Store::Context cx) const |
If this is an i31 , get the value zero-extended. | |
std::optional< int32_t > | i31 (Store::Context cx) const |
If this is an i31 , get the value sign-extended. | |
Static Public Member Functions | |
static AnyRef | i31 (Store::Context cx, uint32_t value) |
Friends | |
class | Val |
Representation of a WebAssembly anyref
value.
|
inlinestatic |
Creates a new AnyRef
which is an i31
with the given value
, truncated if the upper bit is set.
|
inline |
Returns the raw underlying C API value.
This class still retains ownership of the pointer.
|
inline |
Unroots this value from the context provided, enabling a future GC to collect the internal object if there are no more references.