Struct tinywasm_parser::TinyWasmModule
source · pub struct TinyWasmModule {
pub start_func: Option<u32>,
pub funcs: Box<[WasmFunction]>,
pub func_types: Box<[FuncType]>,
pub exports: Box<[Export]>,
pub globals: Box<[Global]>,
pub table_types: Box<[TableType]>,
pub memory_types: Box<[MemoryType]>,
pub imports: Box<[Import]>,
pub data: Box<[Data]>,
pub elements: Box<[Element]>,
}
Expand description
A TinyWasm WebAssembly Module
This is the internal representation of a WebAssembly module in TinyWasm. TinyWasmModules are validated before being created, so they are guaranteed to be valid (as long as they were created by TinyWasm). This means you should not trust a TinyWasmModule created by a third party to be valid.
Fields§
§start_func: Option<u32>
Optional address of the start function
Corresponds to the start
section of the original WebAssembly module.
funcs: Box<[WasmFunction]>
Optimized and validated WebAssembly functions
Contains data from to the code
, func
, and type
sections of the original WebAssembly module.
func_types: Box<[FuncType]>
A vector of type definitions, indexed by TypeAddr
Corresponds to the type
section of the original WebAssembly module.
exports: Box<[Export]>
Exported items of the WebAssembly module.
Corresponds to the export
section of the original WebAssembly module.
globals: Box<[Global]>
Global components of the WebAssembly module.
Corresponds to the global
section of the original WebAssembly module.
table_types: Box<[TableType]>
Table components of the WebAssembly module used to initialize tables.
Corresponds to the table
section of the original WebAssembly module.
memory_types: Box<[MemoryType]>
Memory components of the WebAssembly module used to initialize memories.
Corresponds to the memory
section of the original WebAssembly module.
imports: Box<[Import]>
Imports of the WebAssembly module.
Corresponds to the import
section of the original WebAssembly module.
data: Box<[Data]>
Data segments of the WebAssembly module.
Corresponds to the data
section of the original WebAssembly module.
elements: Box<[Element]>
Element segments of the WebAssembly module.
Corresponds to the elem
section of the original WebAssembly module.
Trait Implementations§
source§impl Clone for TinyWasmModule
impl Clone for TinyWasmModule
source§fn clone(&self) -> TinyWasmModule
fn clone(&self) -> TinyWasmModule
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TinyWasmModule
impl Debug for TinyWasmModule
source§impl Default for TinyWasmModule
impl Default for TinyWasmModule
source§fn default() -> TinyWasmModule
fn default() -> TinyWasmModule
source§impl PartialEq for TinyWasmModule
impl PartialEq for TinyWasmModule
source§fn eq(&self, other: &TinyWasmModule) -> bool
fn eq(&self, other: &TinyWasmModule) -> bool
self
and other
values to be equal, and is used
by ==
.