Struct wasm_encoder::AliasSection [−][src]
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]
&mut self,
instance: u32,
kind: ItemKind,
name: &str
) -> &mut Self
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 Clone for AliasSection
[src]
fn clone(&self) -> AliasSection
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AliasSection
[src]
impl Section for AliasSection
[src]
Auto Trait Implementations
impl RefUnwindSafe for AliasSection
impl Send for AliasSection
impl Sync for AliasSection
impl Unpin for AliasSection
impl UnwindSafe for AliasSection
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,