Wasmtime
wasmtime::AnyRef Class Reference

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 (const AnyRef &other)
 Copy constructor to clone other.
 
AnyRefoperator= (const AnyRef &other)
 Copy assignment to clone from other.
 
 AnyRef (AnyRef &&other)
 Move constructor to move the contents of other.
 
AnyRefoperator= (AnyRef &&other)
 Move assignment to move the contents of other.
 
uint32_t take_raw (Store::Context cx)
 
uint32_t borrow_raw (Store::Context cx) const
 Returns wasmtime_anyref_to_raw.
 
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
 

Detailed Description

Representation of a WebAssembly anyref value.

Member Function Documentation

◆ i31()

static AnyRef wasmtime::AnyRef::i31 ( Store::Context  cx,
uint32_t  value 
)
inlinestatic

Creates a new AnyRef which is an i31 with the given value, truncated if the upper bit is set.

◆ take_raw()

uint32_t wasmtime::AnyRef::take_raw ( Store::Context  cx)
inline

Consumes ownership of the underlying wasmtime_anyref_t and returns the result of wasmtime_anyref_to_raw.


The documentation for this class was generated from the following file: