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
sourceimpl Clone for StartSection
impl Clone for StartSection
sourcefn clone(&self) -> StartSection
fn clone(&self) -> StartSection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for StartSection
impl Debug for StartSection
sourceimpl Encode for StartSection
impl Encode for StartSection
sourceimpl Section for StartSection
impl Section for StartSection
impl Copy for StartSection
Auto Trait Implementations
impl RefUnwindSafe for StartSection
impl Send for StartSection
impl Sync for StartSection
impl Unpin for StartSection
impl UnwindSafe for StartSection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more