Lines Matching refs:std

39   std::optional<Extern> get_export(std::string_view name);
86 template <> struct WasmType<std::optional<ExternRef>> {
90 std::optional<ExternRef> &&ref) { in store()
98 const std::optional<ExternRef> &ref) { in store()
105 static std::optional<ExternRef> load(Store::Context cx, in load()
108 return std::nullopt; in load()
138 return WasmTypeList<std::tuple<T>>::matches(types); in matches()
150 static std::vector<ValType> types() { return {WasmType<T>::kind}; } in types()
154 template <> struct WasmTypeList<std::monostate> {
159 const std::monostate &t) { in store()
164 static std::monostate load(Store::Context cx, wasmtime_val_raw_t *storage) { in load()
167 return std::monostate(); in load()
169 static std::vector<ValType> types() { return {}; } in types()
173 template <typename... T> struct WasmTypeList<std::tuple<T...>> {
184 std::tuple<T...> &&t) { in store()
186 std::apply( in store()
193 const std::tuple<T...> &t) { in store()
195 std::apply( in store()
201 static std::tuple<T...> load(Store::Context cx, wasmtime_val_raw_t *storage) { in load()
203 return std::tuple<T...>{WasmType<T>::load(cx, storage++)...}; // NOLINT in load()
205 static std::vector<ValType> types() { return {WasmType<T>::kind...}; } in types()
215 static std::optional<Trap> invoke(F f, Caller cx, wasmtime_val_raw_t *raw, in invoke()
219 return std::nullopt; in invoke()
225 using Results = WasmTypeList<std::tuple<>>;
228 static std::optional<Trap> invoke(F f, Caller cx, wasmtime_val_raw_t *raw, in invoke()
233 return std::nullopt; in invoke()
239 template <> struct WasmHostRet<std::monostate> : public WasmHostRet<void> {};
247 static std::optional<Trap> invoke(F f, Caller cx, wasmtime_val_raw_t *raw, in invoke()
254 return std::nullopt; in invoke()
263 using Params = WasmTypeList<std::tuple<A...>>;
267 static std::optional<Trap> invoke(F &f, Caller cx, wasmtime_val_raw_t *raw) { in invoke()
269 return std::apply( in invoke()
282 static std::optional<Trap> invoke(F &f, Caller cx, wasmtime_val_raw_t *raw) { in invoke()
283 auto params = WasmTypeList<std::tuple<A...>>::load(cx, raw); in invoke()
284 return std::apply( in invoke()
315 struct WasmHostFunc<T, std::void_t<decltype(&T::operator())>>
355 Result<std::monostate, Trap> result = in raw_callback()
380 std::unique_ptr<F> ptr(reinterpret_cast<F *>(env)); // NOLINT in raw_finalize()
419 std::enable_if_t<
420 std::is_invocable_r_v<Result<std::monostate, Trap>, F, Caller,
425 std::make_unique<F>(f).release(), raw_finalize<F>, &func);
467 std::enable_if_t<WasmHostFunc<F>::Params::valid, bool> = true,
468 std::enable_if_t<WasmHostFunc<F>::Results::valid, bool> = true>
476 std::make_unique<F>(f).release(), in wrap()
502 TrapResult<std::vector<Val>> call(Store::Context cx, const I &begin, in call()
504 std::vector<wasmtime_val_t> raw_params; in call()
510 std::vector<wasmtime_val_t> raw_results(nresults); in call()
523 std::vector<Val> results; in call()
537 TrapResult<std::vector<Val>> call(Store::Context cx, in call()
538 const std::vector<Val> &params) const { in call()
548 TrapResult<std::vector<Val>>
549 call(Store::Context cx, const std::initializer_list<Val> &params) const { in call()
576 std::enable_if_t<WasmTypeList<Params>::valid, bool> = true,
577 std::enable_if_t<WasmTypeList<Results>::valid, bool> = true>
613 std::array<wasmtime_val_raw_t, std::max(WasmTypeList<Params>::size, in call()
636 inline Val::Val(std::optional<Func> func) : val{} { in Val()
645 inline Val::Val(Func func) : Val(std::optional(func)) {} in Val()
646 inline Val::Val(ExternRef ptr) : Val(std::optional(ptr)) {} in Val()
647 inline Val::Val(AnyRef ptr) : Val(std::optional(ptr)) {} in Val()
649 inline std::optional<Func> Val::funcref() const { in funcref()
651 std::abort(); in funcref()
654 return std::nullopt; in funcref()
660 template <> struct detail::WasmType<std::optional<Func>> {
667 const std::optional<Func> func) { in store()
675 static std::optional<Func> load(Store::Context cx, wasmtime_val_raw_t *p) { in load()
677 return std::nullopt; in load()