Struct wasm_encoder::AliasSection
source · [−]pub struct AliasSection { /* private fields */ }
Expand description
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
sourceimpl AliasSection
impl AliasSection
sourcepub fn instance_export(
&mut self,
instance: u32,
kind: ItemKind,
name: &str
) -> &mut Self
pub fn instance_export(
&mut self,
instance: u32,
kind: ItemKind,
name: &str
) -> &mut Self
Define an alias that references the export of a defined instance.
sourcepub fn outer_type(&mut self, depth: u32, ty: u32) -> &mut Self
pub fn outer_type(&mut self, depth: u32, ty: u32) -> &mut Self
Define an alias that references an outer module’s type.
sourcepub fn outer_module(&mut self, depth: u32, module: u32) -> &mut Self
pub fn outer_module(&mut self, depth: u32, module: u32) -> &mut Self
Define an alias that references an outer module’s module.
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 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub 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