[−][src]Struct wasm_encoder::FunctionSection
An encoder for the function section.
Example
use wasm_encoder::{Module, FunctionSection, ValType}; let mut functions = FunctionSection::new(); let type_index = 0; functions.function(type_index); let mut module = Module::new(); module.section(&functions); // Note: this will generate an invalid module because we didn't generate a // code section containing the function body. See the documentation for // `CodeSection` for details. let wasm_bytes = module.finish();
Implementations
impl FunctionSection
[src]
pub fn new() -> FunctionSection
[src]
Construct a new function section encoder.
pub fn function(&mut self, type_index: u32) -> &mut Self
[src]
Define a function that uses the given type.
Trait Implementations
impl Section for FunctionSection
[src]
Auto Trait Implementations
impl RefUnwindSafe for FunctionSection
impl Send for FunctionSection
impl Sync for FunctionSection
impl Unpin for FunctionSection
impl UnwindSafe for FunctionSection
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,