3#ifndef WASMTIME_COMPONENT_FUNC_HH
4#define WASMTIME_COMPONENT_FUNC_HH
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
41 if (error !=
nullptr) {
44 return std::monostate();
53 if (error !=
nullptr) {
56 return std::monostate();
Errors coming from Wasmtime.
Definition: error.hh:26
Fallible result type used for Wasmtime.
Definition: error.hh:70
Span class used when c++20 is not available.
Definition: span.hh:47
std::size_t size() const
Returns number of data that referred by Span class.
Definition: span.hh:81
T * data() const
Returns pointer to data.
Definition: span.hh:78
An interior pointer into a Store.
Definition: store.hh:66
const wasmtime_context_t * capi() const
Returns the underlying C API pointer.
Definition: store.hh:160
Type information about a component function.
Definition: component/types/func.hh:21
Class representing an instantiated WebAssembly component.
Definition: component/func.hh:24
FuncType type(Store::Context cx) const
Returns the type of this function.
Definition: component/func.hh:60
const wasmtime_component_func_t * capi() const
Returns the underlying C API pointer.
Definition: component/func.hh:32
Result< std::monostate > post_return(Store::Context cx) const
Invokes the post-return canonical ABI option, if specified.
Definition: component/func.hh:50
Result< std::monostate > call(Store::Context cx, Span< const Val > args, Span< Val > results) const
Invokes this component function with the provided args and the results are placed in results.
Definition: component/func.hh:36
Func(const wasmtime_component_func_t &func)
Constructs an Func from the underlying C API struct.
Definition: component/func.hh:29
static const Raw * to_capi(const Val *capi)
Definition: component/val.hh:476
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 wasmtime_error_t * wasmtime_component_func_post_return(const wasmtime_component_func_t *func, wasmtime_context_t *context)
Invokes the post-return canonical ABI option, if specified, after a wasmtime_component_func_call has ...
WASM_API_EXTERN wasmtime_error_t * wasmtime_component_func_call(const wasmtime_component_func_t *func, wasmtime_context_t *context, const wasmtime_component_val_t *args, size_t args_size, wasmtime_component_val_t *results, size_t results_size)
Invokes func with the args given and returns the result.
Build-time defines for how the C API was built.
Representation of a function in Wasmtime.
Definition: component/func.h:25
Errors generated by Wasmtime.