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 moreSource§impl Debug for StartSection
impl Debug for StartSection
Source§impl Encode for StartSection
impl Encode for StartSection
Source§impl Section for StartSection
impl Section for StartSection
impl Copy for StartSection
Auto Trait Implementations§
impl Freeze for StartSection
impl RefUnwindSafe for StartSection
impl Send for StartSection
impl Sync for StartSection
impl Unpin for StartSection
impl UnwindSafe for StartSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more