[][src]Struct wasm_encoder::AliasSection

pub struct AliasSection { /* fields omitted */ }

An encoder for the alias section.

Note that this is part of the module linking proposal and is not currently part of stable WebAssembly.

Example

use wasm_encoder::{Module, AliasSection, ItemKind};

let mut aliases = AliasSection::new();
aliases.outer_type(0, 2);
aliases.instance_export(0, ItemKind::Function, "foo");

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

let wasm_bytes = module.finish();

Implementations

impl AliasSection[src]

pub fn new() -> AliasSection[src]

Construct a new alias section encoder.

pub fn instance_export(
    &mut self,
    instance: u32,
    kind: ItemKind,
    name: &str
) -> &mut Self
[src]

Define an alias that references the export of a defined instance.

pub fn outer_type(&mut self, depth: u32, ty: u32) -> &mut Self[src]

Define an alias that references an outer module's type.

pub fn outer_module(&mut self, depth: u32, module: u32) -> &mut Self[src]

Define an alias that references an outer module's module.

Trait Implementations

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