3#ifndef WASMTIME_COMPONENT_TYPES_COMPONENT_H
4#define WASMTIME_COMPONENT_TYPES_COMPONENT_H
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
48 const char *name,
size_t name_len,
58 size_t nth,
const char **name_ret,
size_t *name_len_ret,
73 const char *name,
size_t name_len,
83 size_t nth,
const char **name_ret,
size_t *name_len_ret,
88#define WASMTIME_COMPONENT_ITEM_COMPONENT 0
91#define WASMTIME_COMPONENT_ITEM_COMPONENT_INSTANCE 1
94#define WASMTIME_COMPONENT_ITEM_MODULE 2
97#define WASMTIME_COMPONENT_ITEM_COMPONENT_FUNC 3
100#define WASMTIME_COMPONENT_ITEM_RESOURCE 4
103#define WASMTIME_COMPONENT_ITEM_CORE_FUNC 5
106#define WASMTIME_COMPONENT_ITEM_TYPE 6
WASM_API_EXTERN bool wasmtime_component_type_export_get(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, const char *name, size_t name_len, struct wasmtime_component_item_t *ret)
Retrieves the export with the specified name.
uint8_t wasmtime_component_item_kind_t
Discriminant used in wasmtime_component_item_t::kind.
Definition: component/types/component.h:109
WASM_API_EXTERN bool wasmtime_component_type_import_get(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, const char *name, size_t name_len, struct wasmtime_component_item_t *ret)
Retrieves the import with the specified name.
struct wasmtime_component_type_t wasmtime_component_type_t
Represents the type of a WebAssembly component.
Definition: component/types/component.h:22
struct wasmtime_component_item_t wasmtime_component_item_t
Represents a single item in a component's import or export list.
WASM_API_EXTERN void wasmtime_component_item_delete(wasmtime_component_item_t *ptr)
Deallocates a component item.
WASM_API_EXTERN wasmtime_component_type_t * wasmtime_component_type_clone(const wasmtime_component_type_t *ty)
Clones a component type.
WASM_API_EXTERN bool wasmtime_component_type_import_nth(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_item_t *type_ret)
Retrieves the nth import.
union wasmtime_component_item_union wasmtime_component_item_union_t
Represents a single item in a component's import or export list.
WASM_API_EXTERN bool wasmtime_component_type_export_nth(const wasmtime_component_type_t *ty, const wasm_engine_t *engine, size_t nth, const char **name_ret, size_t *name_len_ret, struct wasmtime_component_item_t *type_ret)
Retrieves the nth export.
WASM_API_EXTERN size_t wasmtime_component_type_import_count(const wasmtime_component_type_t *ty, const wasm_engine_t *engine)
Returns the number of imports of a component type.
WASM_API_EXTERN size_t wasmtime_component_type_export_count(const wasmtime_component_type_t *ty, const wasm_engine_t *engine)
Returns the number of exports of a component type.
WASM_API_EXTERN void wasmtime_component_item_clone(const wasmtime_component_item_t *item, wasmtime_component_item_t *out)
Clones a component item.
WASM_API_EXTERN void wasmtime_component_type_delete(wasmtime_component_type_t *ty)
Deallocates a component type.
struct wasmtime_component_func_type_t wasmtime_component_func_type_t
Opaque type representing a component function type.
Definition: component/types/func.h:18
struct wasmtime_component_instance_type wasmtime_component_instance_type_t
Represents the type of a component instance.
Definition: component/types/instance.h:19
struct wasmtime_module_type wasmtime_module_type_t
Represents the type of a module.
Definition: component/types/module.h:17
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
Compilation environment and configuration.
An opaque object representing the type of a function.
Represents a single item in a component's import or export list.
Definition: component/types/component.h:137
wasmtime_component_item_union_t of
The actual item.
Definition: component/types/component.h:141
wasmtime_component_item_kind_t kind
The type discriminant for the of union.
Definition: component/types/component.h:139
Represents a single value type in the component model.
Definition: component/types/val.h:463
Represents a single item in a component's import or export list.
Definition: component/types/component.h:112
wasmtime_component_valtype_t type
Definition: component/types/component.h:133
wasmtime_component_type_t * component
Definition: component/types/component.h:115
wasmtime_component_func_type_t * component_func
Definition: component/types/component.h:124
wasmtime_module_type_t * module
Definition: component/types/component.h:121
wasmtime_component_resource_type_t * resource
Definition: component/types/component.h:127
wasm_functype_t * core_func
Definition: component/types/component.h:130
wasmtime_component_instance_type_t * component_instance
Definition: component/types/component.h:118