use super::types::{FuncType, MemType, TableType};
use super::{Data, Elem, Export, Func, Global, Import};
use crate::core::custom_section::CustomSection;
use crate::core::indices::FuncIdx;
#[derive(Debug, PartialEq)]
pub struct Module {
pub version: [u8; 4],
pub parsed_section_kinds: Vec<SectionKind>,
pub section_headers: Vec<SectionHeader>,
pub custom_sections: Vec<CustomSection>,
pub types: Vec<FuncType>,
pub funcs: Vec<Func>,
pub tables: Vec<TableType>,
pub mems: Vec<MemType>,
pub globals: Vec<Global>,
pub elems: Vec<Elem>,
pub data_count: Option<u32>,
pub datas: Vec<Data>,
pub start: Option<FuncIdx>,
pub imports: Vec<Import>,
pub exports: Vec<Export>,
}
#[derive(PartialEq, Debug)]
pub struct SectionHeader {
pub kind: SectionKind,
pub size: u32,
}
#[derive(PartialEq, PartialOrd, Debug, Copy, Clone)]
pub enum SectionKind {
Custom,
Type,
Import,
Function,
Table,
Memory,
Global,
Export,
Start,
Element,
DataCount,
Code,
Data,
}