wasmtime/runtime/vm/imports.rs
1use crate::runtime::vm::vmcontext::{
2 VMFunctionImport, VMGlobalImport, VMMemoryImport, VMTableImport, VMTagImport,
3};
4
5/// Resolved import pointers.
6///
7/// Note that some of these fields are slices, not `PrimaryMap`. They should be
8/// stored in index-order as with the module that we're providing the imports
9/// for, and indexing is all done the same way as the main module's index
10/// spaces.
11///
12/// Also note that the way we compile modules means that for the module linking
13/// proposal all `alias` directives should map to imported items. This means
14/// that each of these items aren't necessarily directly imported, but may be
15/// aliased.
16#[derive(Default)]
17pub struct Imports<'a> {
18 /// Resolved addresses for imported functions.
19 pub functions: &'a [VMFunctionImport],
20
21 /// Resolved addresses for imported tables.
22 pub tables: &'a [VMTableImport],
23
24 /// Resolved addresses for imported memories.
25 pub memories: &'a [VMMemoryImport],
26
27 /// Resolved addresses for imported globals.
28 pub globals: &'a [VMGlobalImport],
29
30 /// Resolved addresses for imported tags.
31 pub tags: &'a [VMTagImport],
32}