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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)