Struct wasm_encoder::StartSection
source · pub struct StartSection {
pub function_index: u32,
}
Expand description
An encoder for the start section of WebAssembly modules.
Example
Note: this doesn’t actually define the function at index 0, its type, or its
code body, so the resulting Wasm module will be invalid. See TypeSection
,
FunctionSection
, and CodeSection
for details on how to generate those
things.
use wasm_encoder::{Module, StartSection};
let start = StartSection { function_index: 0 };
let mut module = Module::new();
module.section(&start);
let wasm_bytes = module.finish();
Fields§
§function_index: u32
The index of the start function.
Trait Implementations§
source§impl Clone for StartSection
impl Clone for StartSection
source§fn clone(&self) -> StartSection
fn clone(&self) -> StartSection
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more