5#ifndef WASMTIME_COMPONENT_TYPES_FUNC_HH
6#define WASMTIME_COMPONENT_TYPES_FUNC_HH
10#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
25 size_t param_count()
const {
33 std::optional<std::pair<std::string_view, ValType>>
34 param_nth(
size_t nth)
const {
35 const char *name_ptr =
nullptr;
39 &name_len, &type_ret)) {
40 return std::make_pair(std::string_view(name_ptr, name_len),
47 std::optional<ValType> result()
const {
50 return ValType(std::move(type_ret));
Type information about a component function.
Definition: component/types/func.hh:21
Represents a component value type.
Definition: component/types/val.hh:184
WASM_API_EXTERN wasmtime_component_func_type_t * wasmtime_component_func_type(const wasmtime_component_func_t *func, wasmtime_context_t *context)
Returns the type of this function.
WASM_API_EXTERN bool wasmtime_component_func_type_result(const wasmtime_component_func_type_t *ty, wasmtime_component_valtype_t *type_ret)
Returns the result, if any, of this component function type.
WASM_API_EXTERN size_t wasmtime_component_func_type_param_count(const wasmtime_component_func_type_t *ty)
Returns the number of parameters of a component function type.
WASM_API_EXTERN bool wasmtime_component_func_type_param_nth(const wasmtime_component_func_type_t *ty, size_t nth, const char **name_ret, size_t *name_len_ret, wasmtime_component_valtype_t *type_ret)
Retrieves the nth parameter.
WASM_API_EXTERN bool wasmtime_component_func_type_async(const wasmtime_component_func_type_t *ty)
Returns whether this is an async function.
Build-time defines for how the C API was built.
Represents a single value type in the component model.
Definition: component/types/val.h:463