3#ifndef WASMTIME_COMPONENT_TYPES_VAL_H
4#define WASMTIME_COMPONENT_TYPES_VAL_H
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
80 const char **name_ret,
size_t *name_len_ret,
119typedef struct wasmtime_component_variant_type
148 const char **name_ret,
size_t *name_len_ret,
bool *has_payload_ret,
179 size_t nth,
const char **name_ret,
180 size_t *name_len_ret);
276 const char **name_ret,
size_t *name_len_ret);
379#define WASMTIME_COMPONENT_VALTYPE_BOOL 0
382#define WASMTIME_COMPONENT_VALTYPE_S8 1
385#define WASMTIME_COMPONENT_VALTYPE_S16 2
388#define WASMTIME_COMPONENT_VALTYPE_S32 3
391#define WASMTIME_COMPONENT_VALTYPE_S64 4
394#define WASMTIME_COMPONENT_VALTYPE_U8 5
397#define WASMTIME_COMPONENT_VALTYPE_U16 6
400#define WASMTIME_COMPONENT_VALTYPE_U32 7
403#define WASMTIME_COMPONENT_VALTYPE_U64 8
406#define WASMTIME_COMPONENT_VALTYPE_F32 9
409#define WASMTIME_COMPONENT_VALTYPE_F64 10
412#define WASMTIME_COMPONENT_VALTYPE_CHAR 11
415#define WASMTIME_COMPONENT_VALTYPE_STRING 12
418#define WASMTIME_COMPONENT_VALTYPE_LIST 13
421#define WASMTIME_COMPONENT_VALTYPE_RECORD 14
424#define WASMTIME_COMPONENT_VALTYPE_TUPLE 15
427#define WASMTIME_COMPONENT_VALTYPE_VARIANT 16
430#define WASMTIME_COMPONENT_VALTYPE_ENUM 17
433#define WASMTIME_COMPONENT_VALTYPE_OPTION 18
436#define WASMTIME_COMPONENT_VALTYPE_RESULT 19
439#define WASMTIME_COMPONENT_VALTYPE_FLAGS 20
442#define WASMTIME_COMPONENT_VALTYPE_OWN 21
445#define WASMTIME_COMPONENT_VALTYPE_BORROW 22
448#define WASMTIME_COMPONENT_VALTYPE_FUTURE 23
451#define WASMTIME_COMPONENT_VALTYPE_STREAM 24
454#define WASMTIME_COMPONENT_VALTYPE_ERROR_CONTEXT 25
457#define WASMTIME_COMPONENT_VALTYPE_MAP 26
WASM_API_EXTERN wasmtime_component_enum_type_t * wasmtime_component_enum_type_clone(const wasmtime_component_enum_type_t *ty)
Clones a component enum type.
WASM_API_EXTERN void wasmtime_component_tuple_type_delete(wasmtime_component_tuple_type_t *ptr)
Deallocates a component tuple type.
WASM_API_EXTERN bool wasmtime_component_result_type_err(const wasmtime_component_result_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the err type of a component result type. The returned type must be deallocated with wasmtime_...
WASM_API_EXTERN void wasmtime_component_option_type_ty(const wasmtime_component_option_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the inner type of a component option type.
struct wasmtime_component_map_type wasmtime_component_map_type_t
Opaque type representing a component map type.
Definition: component/types/val.h:341
WASM_API_EXTERN wasmtime_component_result_type_t * wasmtime_component_result_type_clone(const wasmtime_component_result_type_t *ty)
Clones a component result type.
WASM_API_EXTERN size_t wasmtime_component_tuple_type_types_count(const wasmtime_component_tuple_type_t *ty)
Returns the number of types in a component tuple type.
WASM_API_EXTERN size_t wasmtime_component_enum_type_names_count(const wasmtime_component_enum_type_t *ty)
Returns the number of names in a component enum type.
WASM_API_EXTERN bool wasmtime_component_tuple_type_types_nth(const wasmtime_component_tuple_type_t *ty, size_t nth, struct wasmtime_component_valtype_t *type_ret)
Returns the nth type in a component tuple type.
WASM_API_EXTERN wasmtime_component_list_type_t * wasmtime_component_list_type_clone(const wasmtime_component_list_type_t *ty)
Clones a component list type.
WASM_API_EXTERN wasmtime_component_option_type_t * wasmtime_component_option_type_clone(const wasmtime_component_option_type_t *ty)
Clones a component option type.
WASM_API_EXTERN bool wasmtime_component_future_type_equal(const wasmtime_component_future_type_t *a, const wasmtime_component_future_type_t *b)
Compares two component future types for equality.
WASM_API_EXTERN size_t wasmtime_component_flags_type_names_count(const wasmtime_component_flags_type_t *ty)
Returns the number of names in a component flags type.
WASM_API_EXTERN bool wasmtime_component_variant_type_equal(const wasmtime_component_variant_type_t *a, const wasmtime_component_variant_type_t *b)
Compares two component variant types for equality.
struct wasmtime_component_flags_type wasmtime_component_flags_type_t
Opaque type representing a component flags type.
Definition: component/types/val.h:251
WASM_API_EXTERN size_t wasmtime_component_variant_type_case_count(const wasmtime_component_variant_type_t *ty)
Returns the number of cases in a component variant type.
WASM_API_EXTERN bool wasmtime_component_stream_type_ty(const wasmtime_component_stream_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the inner type of a component stream type.
struct wasmtime_component_future_type wasmtime_component_future_type_t
Opaque type representing a component future type.
Definition: component/types/val.h:281
WASM_API_EXTERN void wasmtime_component_valtype_clone(const wasmtime_component_valtype_t *ty, wasmtime_component_valtype_t *out)
Clones a component value type.
struct wasmtime_component_record_type wasmtime_component_record_type_t
Opaque type representing a component record type.
Definition: component/types/val.h:51
struct wasmtime_component_stream_type wasmtime_component_stream_type_t
Opaque type representing a component stream type.
Definition: component/types/val.h:311
WASM_API_EXTERN bool wasmtime_component_record_type_field_nth(const wasmtime_component_record_type_t *ty, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_valtype_t *type_ret)
Returns the nth field in a component record type.
WASM_API_EXTERN bool wasmtime_component_tuple_type_equal(const wasmtime_component_tuple_type_t *a, const wasmtime_component_tuple_type_t *b)
Compares two component tuple types for equality.
WASM_API_EXTERN bool wasmtime_component_stream_type_equal(const wasmtime_component_stream_type_t *a, const wasmtime_component_stream_type_t *b)
Compares two component stream types for equality.
WASM_API_EXTERN wasmtime_component_future_type_t * wasmtime_component_future_type_clone(const wasmtime_component_future_type_t *ty)
Clones a component future type.
WASM_API_EXTERN void wasmtime_component_list_type_delete(wasmtime_component_list_type_t *ptr)
Deallocates a component list type.
WASM_API_EXTERN void wasmtime_component_enum_type_delete(wasmtime_component_enum_type_t *ptr)
Deallocates a component enum type.
WASM_API_EXTERN wasmtime_component_tuple_type_t * wasmtime_component_tuple_type_clone(const wasmtime_component_tuple_type_t *ty)
Clones a component tuple type.
struct wasmtime_component_tuple_type wasmtime_component_tuple_type_t
Opaque type representing a component tuple type.
Definition: component/types/val.h:86
WASM_API_EXTERN void wasmtime_component_variant_type_delete(wasmtime_component_variant_type_t *ptr)
Deallocates a component variant type.
WASM_API_EXTERN bool wasmtime_component_result_type_ok(const wasmtime_component_result_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the ok type of a component result type. The returned type must be deallocated with wasmtime_c...
WASM_API_EXTERN wasmtime_component_record_type_t * wasmtime_component_record_type_clone(const wasmtime_component_record_type_t *ty)
Clones a component record type.
struct wasmtime_component_enum_type wasmtime_component_enum_type_t
Opaque type representing a component enum type.
Definition: component/types/val.h:154
WASM_API_EXTERN bool wasmtime_component_variant_type_case_nth(const wasmtime_component_variant_type_t *ty, size_t nth, const char **name_ret, size_t *name_len_ret, bool *has_payload_ret, struct wasmtime_component_valtype_t *payload_ret)
Returns the nth case in a component variant type. The returned payload type must be deallocated with ...
WASM_API_EXTERN bool wasmtime_component_record_type_equal(const wasmtime_component_record_type_t *a, const wasmtime_component_record_type_t *b)
Compares two component record types for equality.
WASM_API_EXTERN bool wasmtime_component_flags_type_equal(const wasmtime_component_flags_type_t *a, const wasmtime_component_flags_type_t *b)
Compares two component flags types for equality.
WASM_API_EXTERN void wasmtime_component_map_type_value(const wasmtime_component_map_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the value type of a component map type.
WASM_API_EXTERN bool wasmtime_component_enum_type_equal(const wasmtime_component_enum_type_t *a, const wasmtime_component_enum_type_t *b)
Compares two component enum types for equality.
struct wasmtime_component_option_type wasmtime_component_option_type_t
Opaque type representing a component option type.
Definition: component/types/val.h:185
WASM_API_EXTERN void wasmtime_component_valtype_delete(wasmtime_component_valtype_t *ptr)
Deallocates a component value type.
WASM_API_EXTERN void wasmtime_component_option_type_delete(wasmtime_component_option_type_t *ptr)
Deallocates a component option type.
WASM_API_EXTERN bool wasmtime_component_future_type_ty(const wasmtime_component_future_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the inner type of a component future type.
union wasmtime_component_valtype_union wasmtime_component_valtype_union_t
Represents a single value type in the component model.
WASM_API_EXTERN wasmtime_component_map_type_t * wasmtime_component_map_type_clone(const wasmtime_component_map_type_t *ty)
Clones a component map type.
WASM_API_EXTERN bool wasmtime_component_flags_type_names_nth(const wasmtime_component_flags_type_t *ty, size_t nth, const char **name_ret, size_t *name_len_ret)
Returns the nth name in a component flags type.
WASM_API_EXTERN bool wasmtime_component_enum_type_names_nth(const wasmtime_component_enum_type_t *ty, size_t nth, const char **name_ret, size_t *name_len_ret)
Returns the nth name in a component enum type.
WASM_API_EXTERN void wasmtime_component_map_type_delete(wasmtime_component_map_type_t *ptr)
Deallocates a component map type.
WASM_API_EXTERN size_t wasmtime_component_record_type_field_count(const wasmtime_component_record_type_t *ty)
Returns the number of fields in a component record type.
WASM_API_EXTERN bool wasmtime_component_list_type_equal(const wasmtime_component_list_type_t *a, const wasmtime_component_list_type_t *b)
Compares two component list types for equality.
WASM_API_EXTERN wasmtime_component_stream_type_t * wasmtime_component_stream_type_clone(const wasmtime_component_stream_type_t *ty)
Clones a component stream type.
struct wasmtime_component_variant_type wasmtime_component_variant_type_t
Opaque type representing a component variant type.
Definition: component/types/val.h:119
WASM_API_EXTERN void wasmtime_component_map_type_key(const wasmtime_component_map_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the key type of a component map type.
WASM_API_EXTERN void wasmtime_component_result_type_delete(wasmtime_component_result_type_t *ptr)
Deallocates a component result type.
struct wasmtime_component_valtype_t wasmtime_component_valtype_t
Represents a single value type in the component model.
uint8_t wasmtime_component_valtype_kind_t
Discriminant used in wasmtime_component_valtype_t::kind.
Definition: component/types/val.h:460
struct wasmtime_component_result_type wasmtime_component_result_type_t
Opaque type representing a component result type.
Definition: component/types/val.h:215
struct wasmtime_component_list_type wasmtime_component_list_type_t
Opaque type representing a component list type.
Definition: component/types/val.h:22
WASM_API_EXTERN bool wasmtime_component_valtype_equal(const wasmtime_component_valtype_t *a, const wasmtime_component_valtype_t *b)
Compares two component value types for equality.
WASM_API_EXTERN void wasmtime_component_future_type_delete(wasmtime_component_future_type_t *ptr)
Deallocates a component future type.
WASM_API_EXTERN void wasmtime_component_stream_type_delete(wasmtime_component_stream_type_t *ptr)
Deallocates a component stream type.
WASM_API_EXTERN void wasmtime_component_list_type_element(const wasmtime_component_list_type_t *ty, struct wasmtime_component_valtype_t *type_ret)
Returns the element type of a component list type.
WASM_API_EXTERN bool wasmtime_component_option_type_equal(const wasmtime_component_option_type_t *a, const wasmtime_component_option_type_t *b)
Compares two component option types for equality.
WASM_API_EXTERN wasmtime_component_variant_type_t * wasmtime_component_variant_type_clone(const wasmtime_component_variant_type_t *ty)
Clones a component variant type.
WASM_API_EXTERN bool wasmtime_component_result_type_equal(const wasmtime_component_result_type_t *a, const wasmtime_component_result_type_t *b)
Compares two component result types for equality.
WASM_API_EXTERN void wasmtime_component_record_type_delete(wasmtime_component_record_type_t *ptr)
Deallocates a component record type.
WASM_API_EXTERN bool wasmtime_component_map_type_equal(const wasmtime_component_map_type_t *a, const wasmtime_component_map_type_t *b)
Compares two component map types for equality.
WASM_API_EXTERN wasmtime_component_flags_type_t * wasmtime_component_flags_type_clone(const wasmtime_component_flags_type_t *ty)
Clones a component flags type.
WASM_API_EXTERN void wasmtime_component_flags_type_delete(wasmtime_component_flags_type_t *ptr)
Deallocates a component flags type.
Build-time defines for how the C API was built.
struct wasmtime_component_resource_type wasmtime_component_resource_type_t
Represents the type of a component resource.
Definition: resource.h:21
Represents a single value type in the component model.
Definition: component/types/val.h:506
wasmtime_component_valtype_union_t of
The actual type.
Definition: component/types/val.h:510
wasmtime_component_valtype_kind_t kind
The type discriminant for the of union.
Definition: component/types/val.h:508
Represents a single value type in the component model.
Definition: component/types/val.h:463
wasmtime_component_flags_type_t * flags
Definition: component/types/val.h:487
wasmtime_component_option_type_t * option
Definition: component/types/val.h:481
wasmtime_component_record_type_t * record
Definition: component/types/val.h:469
wasmtime_component_resource_type_t * borrow
Definition: component/types/val.h:493
wasmtime_component_list_type_t * list
Definition: component/types/val.h:466
wasmtime_component_tuple_type_t * tuple
Definition: component/types/val.h:472
wasmtime_component_future_type_t * future
Definition: component/types/val.h:496
wasmtime_component_result_type_t * result
Definition: component/types/val.h:484
wasmtime_component_map_type_t * map
Definition: component/types/val.h:502
wasmtime_component_enum_type_t * enum_
Definition: component/types/val.h:478
wasmtime_component_stream_type_t * stream
Definition: component/types/val.h:499
wasmtime_component_variant_type_t * variant
Definition: component/types/val.h:475