3#ifndef WASMTIME_COMPONENT_FUNC_HH
4#define WASMTIME_COMPONENT_FUNC_HH
8#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
40 if (error !=
nullptr) {
43 return std::monostate();
52 if (error !=
nullptr) {
55 return std::monostate();
Errors coming from Wasmtime.
Definition: error.hh:25
Fallible result type used for Wasmtime.
Definition: error.hh:82
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:60
const wasmtime_context_t * capi() const
Returns the underlying C API pointer.
Definition: store.hh:154
Class representing an instantiated WebAssembly component.
Definition: component/func.hh:23
const wasmtime_component_func_t * capi() const
Returns the underlying C API pointer.
Definition: component/func.hh:31
Result< std::monostate > post_return(Store::Context cx) const
Invokes the post-return canonical ABI option, if specified.
Definition: component/func.hh:49
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:35
Func(const wasmtime_component_func_t &func)
Constructs an Func from the underlying C API struct.
Definition: component/func.hh:28
static const Raw * to_capi(const Val *capi)
Definition: component/val.hh:598
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 ...
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:24
Errors generated by Wasmtime.