Struct wasm_encoder::FunctionSection[][src]

pub struct FunctionSection { /* fields omitted */ }

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 Clone for FunctionSection[src]

impl Debug for FunctionSection[src]

impl Section for FunctionSection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.