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 more