wasmtime_runtime/
imports.rs

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