[][src]Struct wasm_encoder::ExportSection

pub struct ExportSection { /* fields omitted */ }

An encoder for the export section.

Example

use wasm_encoder::{
    Export, ExportSection, TableSection, TableType, Limits, Module, ValType,
};

let mut tables = TableSection::new();
tables.table(TableType {
    element_type: ValType::FuncRef,
    limits: Limits {
        min: 128,
        max: None,
    },
});

let mut exports = ExportSection::new();
exports.export("my-table", Export::Table(0));

let mut module = Module::new();
module
    .section(&tables)
    .section(&exports);

let wasm_bytes = module.finish();

Implementations

impl ExportSection[src]

pub fn new() -> ExportSection[src]

Create a new export section encoder.

pub fn export(&mut self, name: &str, export: Export) -> &mut Self[src]

Define an export.

Trait Implementations

impl Section for ExportSection[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, 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.