Struct wasm_encoder::AliasSection 
source · [−]pub struct AliasSection { /* private fields */ }Expand description
An encoder for the alias section of WebAssembly component.
Example
use wasm_encoder::{Component, AliasSection, AliasExportKind};
let mut aliases = AliasSection::new();
aliases.outer_type(0, 2);
aliases.instance_export(0, AliasExportKind::Function, "foo");
let mut component = Component::new();
component.section(&aliases);
let bytes = component.finish();Implementations
sourceimpl AliasSection
 
impl AliasSection
sourcepub fn instance_export(
    &mut self, 
    instance: u32, 
    kind: AliasExportKind, 
    name: &str
) -> &mut Self
 
pub fn instance_export(
    &mut self, 
    instance: u32, 
    kind: AliasExportKind, 
    name: &str
) -> &mut Self
Define an alias that references the export of a defined instance.
sourcepub fn outer_type(&mut self, count: u32, index: u32) -> &mut Self
 
pub fn outer_type(&mut self, count: u32, index: u32) -> &mut Self
Define an alias to an outer type.
The count starts at 0 to represent the current component.
sourcepub fn outer_module(&mut self, count: u32, index: u32) -> &mut Self
 
pub fn outer_module(&mut self, count: u32, index: u32) -> &mut Self
Define an alias to an outer module.
The count starts at 0 to represent the current component.
sourcepub fn outer_component(&mut self, count: u32, index: u32) -> &mut Self
 
pub fn outer_component(&mut self, count: u32, index: u32) -> &mut Self
Define an alias to an outer component.
The count starts at 0 to represent the current component.
Trait Implementations
sourceimpl Clone for AliasSection
 
impl Clone for AliasSection
sourcefn clone(&self) -> AliasSection
 
fn clone(&self) -> AliasSection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl ComponentSection for AliasSection
 
impl ComponentSection for AliasSection
sourceimpl Debug for AliasSection
 
impl Debug for AliasSection
sourceimpl Default for AliasSection
 
impl Default for AliasSection
sourcefn default() -> AliasSection
 
fn default() -> AliasSection
Returns the “default value” for a type. Read more
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
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
    T: Clone, 
 
impl<T> ToOwned for T where
    T: Clone, 
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
 
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more