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);
342#define WASMTIME_COMPONENT_VALTYPE_BOOL 0
345#define WASMTIME_COMPONENT_VALTYPE_S8 1
348#define WASMTIME_COMPONENT_VALTYPE_S16 2
351#define WASMTIME_COMPONENT_VALTYPE_S32 3
354#define WASMTIME_COMPONENT_VALTYPE_S64 4
357#define WASMTIME_COMPONENT_VALTYPE_U8 5
360#define WASMTIME_COMPONENT_VALTYPE_U16 6
363#define WASMTIME_COMPONENT_VALTYPE_U32 7
366#define WASMTIME_COMPONENT_VALTYPE_U64 8
369#define WASMTIME_COMPONENT_VALTYPE_F32 9
372#define WASMTIME_COMPONENT_VALTYPE_F64 10
375#define WASMTIME_COMPONENT_VALTYPE_CHAR 11
378#define WASMTIME_COMPONENT_VALTYPE_STRING 12
381#define WASMTIME_COMPONENT_VALTYPE_LIST 13
384#define WASMTIME_COMPONENT_VALTYPE_RECORD 14
387#define WASMTIME_COMPONENT_VALTYPE_TUPLE 15
390#define WASMTIME_COMPONENT_VALTYPE_VARIANT 16
393#define WASMTIME_COMPONENT_VALTYPE_ENUM 17
396#define WASMTIME_COMPONENT_VALTYPE_OPTION 18
399#define WASMTIME_COMPONENT_VALTYPE_RESULT 19
402#define WASMTIME_COMPONENT_VALTYPE_FLAGS 20
405#define WASMTIME_COMPONENT_VALTYPE_OWN 21
408#define WASMTIME_COMPONENT_VALTYPE_BORROW 22
411#define WASMTIME_COMPONENT_VALTYPE_FUTURE 23
414#define WASMTIME_COMPONENT_VALTYPE_STREAM 24
417#define WASMTIME_COMPONENT_VALTYPE_ERROR_CONTEXT 25
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.
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 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 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 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_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:420
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 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:463
wasmtime_component_valtype_union_t of
The actual type.
Definition: component/types/val.h:467
wasmtime_component_valtype_kind_t kind
The type discriminant for the of union.
Definition: component/types/val.h:465
Represents a single value type in the component model.
Definition: component/types/val.h:423
wasmtime_component_flags_type_t * flags
Definition: component/types/val.h:447
wasmtime_component_option_type_t * option
Definition: component/types/val.h:441
wasmtime_component_record_type_t * record
Definition: component/types/val.h:429
wasmtime_component_resource_type_t * borrow
Definition: component/types/val.h:453
wasmtime_component_list_type_t * list
Definition: component/types/val.h:426
wasmtime_component_tuple_type_t * tuple
Definition: component/types/val.h:432
wasmtime_component_future_type_t * future
Definition: component/types/val.h:456
wasmtime_component_result_type_t * result
Definition: component/types/val.h:444
wasmtime_component_enum_type_t * enum_
Definition: component/types/val.h:438
wasmtime_component_stream_type_t * stream
Definition: component/types/val.h:459
wasmtime_component_variant_type_t * variant
Definition: component/types/val.h:435