#[repr(C)]pub struct WasmHeader {Show 16 fields
pub wasm_magic: u32,
pub header_version: u16,
pub role: u8,
pub target: u8,
pub required_features: u16,
pub export_count: u16,
pub bytecode_size: u32,
pub compressed_size: u32,
pub compression: u8,
pub min_memory_pages: u8,
pub max_memory_pages: u8,
pub table_count: u8,
pub bytecode_hash: [u8; 32],
pub bootstrap_priority: u8,
pub interpreter_type: u8,
pub reserved: [u8; 6],
}Expand description
64-byte header for WASM_SEG payloads.
Follows the standard 64-byte SegmentHeader. The WASM bytecode
follows immediately after this header within the segment payload.
For self-bootstrapping files, two WASM_SEGs are present:
role = Interpreter— a minimal WASM interpreter (~50 KB)role = Microkernel— the RVF query engine (~5.5 KB)
The bootstrap sequence is:
- Host reads file, finds WASM_SEG with
role = Interpreter - Host loads interpreter bytecode into any available execution engine
- Interpreter instantiates the microkernel WASM_SEG
- Microkernel processes VEC_SEG, INDEX_SEG, etc.
Fields§
§wasm_magic: u32Magic: WASM_MAGIC (0x5256574D, “RVWM”).
header_version: u16WasmHeader format version (currently 1).
role: u8Role in the bootstrap chain (see WasmRole).
target: u8Target platform (see WasmTarget).
required_features: u16Required WASM features bitfield (see WASM_FEAT_*).
export_count: u16Number of exports in the WASM module.
bytecode_size: u32Uncompressed WASM bytecode size (bytes).
compressed_size: u32Compressed bytecode size (0 if uncompressed).
compression: u8Compression algorithm (same enum as SegmentHeader).
min_memory_pages: u8Minimum linear memory pages required (64 KB each).
max_memory_pages: u8Maximum linear memory pages (0 = no limit).
table_count: u8Number of WASM tables.
bytecode_hash: [u8; 32]SHAKE-256-256 hash of uncompressed bytecode.
bootstrap_priority: u8Priority order for bootstrap resolution (lower = tried first). The interpreter with lowest priority is used when multiple are present.
interpreter_type: u8If role=Interpreter, this is the interpreter type: 0x00 = generic stack machine, 0x01 = wasm3-compatible, 0x02 = wamr-compatible, 0x03 = wasmi-compatible.
reserved: [u8; 6]Reserved (must be zero).
Implementations§
Trait Implementations§
Source§impl Clone for WasmHeader
impl Clone for WasmHeader
Source§fn clone(&self) -> WasmHeader
fn clone(&self) -> WasmHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more