|
Wasmtime
|
Class representing an instantiated WebAssembly component. More...
#include <val.hh>
Public Member Functions | |
| Val (Raw &&capi) | |
| Val (const Val &other) | |
Copy constructor to clone other. More... | |
| Val & | operator= (const Val &other) |
Copy assignment to clone from other. More... | |
| Val (Val &&other) | |
Move constructor to move the contents of other. More... | |
| Val & | operator= (Val &&other) |
Move assignment to move the contents of other. More... | |
| const Raw * | capi () const |
| Returns a pointer to the underlying C API representation. More... | |
| Val (bool v) | |
| Creates a new boolean value. | |
| Val (uint8_t v) | |
| Creates a new u8 value. | |
| Val (int8_t v) | |
| Creates a new s8 value. | |
| Val (uint16_t v) | |
| Creates a new u16 value. | |
| Val (int16_t v) | |
| Creates a new s16 value. | |
| Val (uint32_t v) | |
| Creates a new u32 value. | |
| Val (int32_t v) | |
| Creates a new s32 value. | |
| Val (uint64_t v) | |
| Creates a new u64 value. | |
| Val (int64_t v) | |
| Creates a new s64 value. | |
| Val (float v) | |
| Creates a new f32 value. | |
| Val (double v) | |
| Creates a new f64 value. | |
| Val (List v) | |
| Creates a new list value. | |
| Val (Record r) | |
| Creates a new record value. | |
| Val (Tuple v) | |
| Creates a new tuple value. | |
| Val (Variant v) | |
| Creates a new variant value. | |
| Val (WitOption v) | |
| Creates a new option value. | |
| Val (WitResult r) | |
| Creates a new result value. | |
| Val (Flags f) | |
| Creates a new flags value. | |
| Val (ResourceAny r) | |
| Creates a new resource value. | |
| bool | is_bool () const |
| Returns whether this value is a boolean. | |
| bool | get_bool () const |
Returns the boolean value, only valid if is_bool(). | |
| bool | is_u8 () const |
| Returns whether this value is a u8. | |
| uint8_t | get_u8 () const |
Returns the u8 value, only valid if is_u8(). | |
| bool | is_s8 () const |
| Returns whether this value is a s8. | |
| int8_t | get_s8 () const |
Returns the s8 value, only valid if is_s8(). | |
| bool | is_u16 () const |
| Returns whether this value is a u16. | |
| uint16_t | get_u16 () const |
Returns the u16 value, only valid if is_u16(). | |
| bool | is_s16 () const |
| Returns whether this value is a s16. | |
| int16_t | get_s16 () const |
Returns the s16 value, only valid if is_s16(). | |
| bool | is_u32 () const |
| Returns whether this value is a u32. | |
| uint32_t | get_u32 () const |
Returns the u32 value, only valid if is_u32(). | |
| bool | is_s32 () const |
| Returns whether this value is a s32. | |
| int32_t | get_s32 () const |
Returns the s32 value, only valid if is_s32(). | |
| bool | is_u64 () const |
| Returns whether this value is a u64. | |
| uint64_t | get_u64 () const |
Returns the u64 value, only valid if is_u64(). | |
| bool | is_s64 () const |
| Returns whether this value is a s64. | |
| int64_t | get_s64 () const |
Returns the s64 value, only valid if is_s64(). | |
| bool | is_f32 () const |
| Returns whether this value is a f32. | |
| float | get_f32 () const |
Returns the f32 value, only valid if is_f32(). | |
| bool | is_f64 () const |
| Returns whether this value is a f64. | |
| double | get_f64 () const |
Returns the f64 value, only valid if is_f64(). | |
| bool | is_string () const |
| Returns whether this value is a string. | |
| std::string_view | get_string () const |
Returns the string value, only valid if is_string(). | |
| bool | is_list () const |
| Returns whether this value is a list. | |
| const List & | get_list () const |
Returns the list value, only valid if is_list(). | |
| bool | is_record () const |
| Returns whether this value is a record. | |
| const Record & | get_record () const |
Returns the record value, only valid if is_record(). | |
| bool | is_tuple () const |
| Returns whether this value is a tuple. | |
| const Tuple & | get_tuple () const |
Returns the tuple value, only valid if is_tuple(). | |
| bool | is_variant () const |
| Returns whether this value is a variant. | |
| const Variant & | get_variant () const |
Returns the variant value, only valid if is_variant(). | |
| bool | is_option () const |
| Returns whether this value is an option. | |
| const WitOption & | get_option () const |
Returns the option value, only valid if is_option(). | |
| bool | is_enum () const |
| Returns whether this value is an enum. | |
| std::string_view | get_enum () const |
Returns the enum discriminant, only valid if is_enum(). | |
| bool | is_result () const |
| Returns whether this value is a result. | |
| const WitResult & | get_result () const |
Returns the result value, only valid if is_result(). | |
| bool | is_flags () const |
| Returns whether this value is flags. | |
| const Flags & | get_flags () const |
Returns the flags value, only valid if is_flags(). | |
| bool | is_resource () const |
| Returns whether this value is a resource. | |
| const ResourceAny & | get_resource () const |
Returns the flags value, only valid if is_flags(). | |
Static Public Member Functions | |
| static const Val * | from_capi (const Raw *capi) |
| static Val * | from_capi (Raw *capi) |
| static const Raw * | to_capi (const Val *capi) |
| static Raw * | to_capi (Val *capi) |
| static Val | char_ (uint32_t v) |
| Creates a new char value. | |
| static Val | string (std::string_view v) |
| Creates a new string value. | |
| static Val | enum_ (std::string_view discriminant) |
| Creates a new enum value. | |
Friends | |
| class | Variant |
| class | WitOption |
| class | WitResult |
Class representing an instantiated WebAssembly component.
|
inlineexplicit |
|
inline |
Copy constructor to clone other.
|
inline |
Move constructor to move the contents of other.
|
inline |
Returns a pointer to the underlying C API representation.
Copy assignment to clone from other.
Move assignment to move the contents of other.