diff options
Diffstat (limited to 'crates/types')
| -rw-r--r-- | crates/types/src/lib.rs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 387a878..a6cf037 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -28,7 +28,7 @@ extern crate alloc; mod instructions; use core::fmt::Debug; -use alloc::boxed::Box; +use alloc::{boxed::Box, string::String}; pub use instructions::*; /// A TinyWasm WebAssembly Module @@ -302,9 +302,14 @@ pub struct Export { #[derive(Debug, Clone)] pub struct Global { + pub ty: GlobalType, + pub init: ConstInstruction, +} + +#[derive(Debug, Clone)] +pub struct GlobalType { pub mutable: bool, pub ty: ValType, - pub init: ConstInstruction, } #[derive(Debug, Clone)] @@ -329,3 +334,19 @@ pub enum MemoryArch { I32, I64, } + +#[derive(Debug, Clone)] +pub struct Import { + /// Represents an import in a WebAssembly module. + pub module: String, + pub name: String, + pub kind: ImportKind, +} + +#[derive(Debug, Clone)] +pub enum ImportKind { + Func(TypeAddr), + Table(TableType), + Mem(MemoryType), + Global(GlobalType), +} |
