[−][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[src]
impl Send for FunctionSection[src]
impl Sync for FunctionSection[src]
impl Unpin for FunctionSection[src]
impl UnwindSafe for FunctionSection[src]
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>,