5#ifndef WASMTIME_TYPES_IMPORT_HH
6#define WASMTIME_TYPES_IMPORT_HH
10#include <wasmtime/helpers.hh>
19#define wasm_importtype_clone wasm_importtype_copy
20 WASMTIME_CLONE_WRAPPER(ImportType, wasm_importtype);
21#undef wasm_importtype_clone
26 friend class ExternType;
40 std::string_view module()
const {
42 return std::string_view(name->data, name->size);
46 std::string_view name()
const {
48 return std::string_view(name->data, name->size);
53 Ref ref()
const {
return Ref(ptr.get()); }
66 List(
const List &other) =
delete;
68 List(List &&other) noexcept : list(other.list) { other.list.
size = 0; }
75 List &operator=(
const List &other) =
delete;
77 List &operator=(List &&other)
noexcept {
78 std::swap(list, other.list);
84 typedef const Ref *iterator;
86 iterator begin()
const {
87 return reinterpret_cast<iterator
>(&list.
data[0]);
90 iterator end()
const {
91 return reinterpret_cast<iterator
>(&list.
data[list.
size]);
94 size_t size()
const {
return list.
size; }
Type information about a WebAssembly import.
Definition: import.hh:17
An opaque object representing the type of a external value. Can be seen as a superclass of wasm_funct...
An opaque object representing the type of an import.
A list of wasm_importtype_t values.
Definition: wasm.h:307
wasm_importtype_t ** data
Pointer to the base of this vector.
Definition: wasm.h:307
size_t size
Length of this vector.
Definition: wasm.h:307
const wasm_externtype_t * wasm_importtype_type(const wasm_importtype_t *)
Returns the type of item this import is importing.
const wasm_name_t * wasm_importtype_name(const wasm_importtype_t *)
Returns the name this import is importing from.
const wasm_name_t * wasm_importtype_module(const wasm_importtype_t *)
Returns the module this import is importing from.
void wasm_importtype_vec_delete(wasm_importtype_vec_t *)
Deallocates import for a vector.