wasm/execution/runtime_structure/
module_instances.rs1use alloc::{collections::btree_map::BTreeMap, string::String};
2
3use crate::{
4 core::{
5 sidetable::Sidetable,
6 structure::modules::indices::{
7 DataIdx, ElemIdx, FuncIdx, GlobalIdx, IdxVec, MemIdx, TableIdx, TypeIdx,
8 },
9 },
10 DataAddr, ElemAddr, ExternVal, FuncAddr, FuncType, GlobalAddr, MemAddr, TableAddr,
11};
12
13#[derive(Debug)]
20pub struct ModuleInst<'b> {
21 pub types: IdxVec<TypeIdx, FuncType>,
22 pub func_addrs: IdxVec<FuncIdx, FuncAddr>,
23 pub table_addrs: IdxVec<TableIdx, TableAddr>,
24 pub mem_addrs: IdxVec<MemIdx, MemAddr>,
25 pub global_addrs: IdxVec<GlobalIdx, GlobalAddr>,
26 pub elem_addrs: IdxVec<ElemIdx, ElemAddr>,
27 pub data_addrs: IdxVec<DataIdx, DataAddr>,
28 pub exports: BTreeMap<String, ExternVal>,
33
34 pub wasm_bytecode: &'b [u8],
36
37 pub sidetable: Sidetable,
39}