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;
38 std::string_view module() {
40 return std::string_view(name->data, name->size);
44 std::string_view name() {
46 return std::string_view(name->data, name->size);
51 Ref ref()
const {
return Ref(ptr.get()); }
64 List(
const List &other) =
delete;
66 List(List &&other) noexcept : list(other.list) { other.list.
size = 0; }
73 List &operator=(
const List &other) =
delete;
75 List &operator=(List &&other)
noexcept {
76 std::swap(list, other.list);
82 typedef const Ref *iterator;
84 iterator begin()
const {
85 return reinterpret_cast<iterator
>(&list.
data[0]);
88 iterator end()
const {
89 return reinterpret_cast<iterator
>(&list.
data[list.
size]);
92 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:293
wasm_importtype_t ** data
Pointer to the base of this vector.
Definition: wasm.h:293
size_t size
Length of this vector.
Definition: wasm.h:293
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.