Wasmtime
component/func.h
Go to the documentation of this file.
1
2
3#ifndef WASMTIME_COMPONENT_FUNC_H
4#define WASMTIME_COMPONENT_FUNC_H
5
6#include <wasmtime/async.h>
9#include <wasmtime/conf.h>
10#include <wasmtime/error.h>
11#include <wasmtime/store.h>
12
13#ifdef WASMTIME_FEATURE_COMPONENT_MODEL
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
27 struct {
29 uint64_t store_id;
31 uint32_t __private1;
32 };
33
35 uint32_t __private2;
37
42WASM_API_EXTERN wasmtime_component_func_type_t *
44 wasmtime_context_t *context);
45
58 const wasmtime_component_val_t *args, size_t args_size,
59 wasmtime_component_val_t *results, size_t results_size);
60
69WASM_API_EXTERN wasmtime_error_t *
71 wasmtime_context_t *context);
72
73#ifdef WASMTIME_FEATURE_COMPONENT_MODEL_ASYNC
74
91 const wasmtime_component_val_t *args, size_t args_size,
92 wasmtime_component_val_t *results, size_t results_size,
93 wasmtime_error_t **error_ret);
94
95#endif // WASMTIME_FEATURE_COMPONENT_MODEL_ASYNC
96
97#ifdef __cplusplus
98} // extern "C"
99#endif
100
101#endif // WASMTIME_FEATURE_COMPONENT_MODEL
102
103#endif // WASMTIME_COMPONENT_FUNC_H
Wasmtime async functionality.
struct wasmtime_call_future wasmtime_call_future_t
The structure representing a asynchronously running function.
Definition: async.h:164
WASM_API_EXTERN wasmtime_call_future_t * wasmtime_component_func_call_async(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, wasmtime_error_t **error_ret)
Invokes func with the args given, returning the results asynchronously.
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.
struct wasmtime_component_func wasmtime_component_func_t
Representation of a function in Wasmtime.
WASM_API_EXTERN wasmtime_error_t * wasmtime_component_func_post_return(const wasmtime_component_func_t *func, wasmtime_context_t *context)
No longer needs to be called; this function has no effect.
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.
struct wasmtime_component_func_type_t wasmtime_component_func_type_t
Opaque type representing a component function type.
Definition: component/types/func.h:18
Build-time defines for how the C API was built.
Definition and accessors of wasmtime_error_t.
Representation of a function in Wasmtime.
Definition: component/func.h:26
uint32_t __private1
Private internal wasmtime information.
Definition: component/func.h:31
uint64_t store_id
Internal identifier of what store this belongs to, never zero.
Definition: component/func.h:29
uint32_t __private2
Private internal wasmtime information.
Definition: component/func.h:35
Represents possible runtime values which a component function can either consume or produce.
Definition: component/val.h:383
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.