| 225 | std::enable_if_t<WasmHostFunc<F>::Params::valid, bool> = true, |
| 226 | std::enable_if_t<WasmHostFunc<F>::Results::valid, bool> = true> |
| 227 | static Func wrap(Store::Context cx, F f) { |
| 228 | using HostFunc = WasmHostFunc<F>; |
| 229 | auto params = HostFunc::Params::types(); |
| 230 | auto results = HostFunc::Results::types(); |
| 231 | auto ty = FuncType::from_iters(params, results); |
| 232 | wasmtime_func_t func; |
| 233 | wasmtime_func_new_unchecked(cx.ptr, ty.ptr.get(), raw_callback_unchecked<F>, |
| 234 | std::make_unique<F>(f).release(), |
| 235 | raw_finalize<F>, &func); |
| 236 | return func; |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * \brief Invoke a WebAssembly function. |
nothing calls this directly
no test coverage detected