Wasmtime
wasmtime::component::ValType Class Reference

Represents a component value type. More...

#include <val.hh>

Public Member Functions

 ValType (wasmtime_component_valtype_t &&ty)
 Creates a component value type from the raw C API representation.
 
 ValType (const ValType &other)
 Copies another type into this one.
 
ValTypeoperator= (const ValType &other)
 Copies another type into this one.
 
 ValType (ValType &&other)
 Moves another type into this one.
 
ValTypeoperator= (ValType &&other)
 Moves another type into this one.
 
bool operator== (const ValType &other) const
 Compares two types to see if they're the same.
 
bool operator!= (const ValType &other) const
 Compares two types to see if they're different.
 
 ValType (ListType list)
 Creates a list value type.
 
 ValType (RecordType record)
 Creates a record value type.
 
 ValType (TupleType tuple)
 Creates a tuple value type.
 
 ValType (VariantType variant)
 Creates a variant value type.
 
 ValType (EnumType enum_)
 Creates an enum value type.
 
 ValType (OptionType option)
 Creates an option value type.
 
 ValType (ResultType result)
 Creates a result value type.
 
 ValType (FlagsType flags)
 Creates a flags value type.
 
 ValType (FutureType future)
 Creates a future value type.
 
 ValType (StreamType stream)
 Creates a stream value type.
 
wasmtime_component_valtype_kind_t kind () const
 Returns the kind of this value type.
 
bool is_bool () const
 Returns true if this is a bool type.
 
bool is_s8 () const
 Returns true if this is an s8 type.
 
bool is_s16 () const
 Returns true if this is an s16 type.
 
bool is_s32 () const
 Returns true if this is an s32 type.
 
bool is_s64 () const
 Returns true if this is an s64 type.
 
bool is_u8 () const
 Returns true if this is a u8 type.
 
bool is_u16 () const
 Returns true if this is a u16 type.
 
bool is_u32 () const
 Returns true if this is a u32 type.
 
bool is_u64 () const
 Returns true if this is a u64 type.
 
bool is_f32 () const
 Returns true if this is an f32 type.
 
bool is_f64 () const
 Returns true if this is an f64 type.
 
bool is_char () const
 Returns true if this is a char type.
 
bool is_string () const
 Returns true if this is a string type.
 
bool is_list () const
 Returns true if this is a list type.
 
bool is_record () const
 Returns true if this is a record type.
 
bool is_tuple () const
 Returns true if this is a tuple type.
 
bool is_variant () const
 Returns true if this is a variant type.
 
bool is_enum () const
 Returns true if this is an enum type.
 
bool is_option () const
 Returns true if this is an option type.
 
bool is_result () const
 Returns true if this is a result type.
 
bool is_flags () const
 Returns true if this is a flags type.
 
bool is_own () const
 Returns true if this is an own type.
 
bool is_borrow () const
 Returns true if this is a borrow type.
 
bool is_future () const
 Returns true if this is a future type.
 
bool is_stream () const
 Returns true if this is a stream type.
 
bool is_error_context () const
 Returns true if this is an error context type.
 
const ListTypelist () const
 Returns the list type, asserting that this is indeed a list.
 
const RecordTyperecord () const
 Returns the record type, asserting that this is indeed a record.
 
const TupleTypetuple () const
 Returns the tuple type, asserting that this is indeed a tuple.
 
const VariantTypevariant () const
 Returns the variant type, asserting that this is indeed a variant.
 
const EnumTypeenum_ () const
 Returns the enum type, asserting that this is indeed a enum.
 
const OptionTypeoption () const
 Returns the option type, asserting that this is indeed a option.
 
const ResultTyperesult () const
 Returns the result type, asserting that this is indeed a result.
 
const FlagsTypeflags () const
 Returns the flags type, asserting that this is indeed a flags.
 
const ResourceTypeborrow () const
 Returns the borrow type, asserting that this is indeed a borrow.
 
const FutureTypefuture () const
 Returns the future type, asserting that this is indeed a future.
 
const StreamTypestream () const
 Returns the stream type, asserting that this is indeed a stream.
 
const wasmtime_component_valtype_tcapi () const
 Returns the underlying C API pointer.
 
wasmtime_component_valtype_tcapi ()
 Returns the underlying C API pointer.
 

Static Public Member Functions

static const ValTypefrom_capi (const wasmtime_component_valtype_t *capi)
 
static ValType new_bool ()
 Creates a bool value type.
 
static ValType new_s8 ()
 Creates an s8 value type.
 
static ValType new_s16 ()
 Creates an s16 value type.
 
static ValType new_s32 ()
 Creates an s32 value type.
 
static ValType new_s64 ()
 Creates an s64 value type.
 
static ValType new_u8 ()
 Creates a u8 value type.
 
static ValType new_u16 ()
 Creates a u16 value type.
 
static ValType new_u32 ()
 Creates a u32 value type.
 
static ValType new_u64 ()
 Creates a u64 value type.
 
static ValType new_f32 ()
 Creates an f32 value type.
 
static ValType new_f64 ()
 Creates an f64 value type.
 
static ValType new_char ()
 Creates a char value type.
 
static ValType new_string ()
 Creates a string value type.
 
static ValType new_own (ResourceType own)
 Creates an own value type.
 
static ValType new_borrow (ResourceType borrow)
 Creates an borrow value type.
 

Detailed Description

Represents a component value type.

Member Function Documentation

◆ from_capi()

static const ValType * wasmtime::component::ValType::from_capi ( const wasmtime_component_valtype_t capi)
inlinestatic

Converts the raw C API representation to this class without taking ownership.


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