Struct wasm_encoder::AliasSection
source · [−]pub struct AliasSection { /* private fields */ }Expand description
An encoder for the core alias section of WebAssembly components.
Example
use wasm_encoder::{Component, AliasSection, ExportKind};
let mut aliases = AliasSection::new();
aliases.instance_export(0, ExportKind::Func, "f");
let mut component = Component::new();
component.section(&aliases);
let bytes = component.finish();Implementations
sourceimpl AliasSection
impl AliasSection
sourcepub fn instance_export(
&mut self,
instance_index: u32,
kind: ExportKind,
name: &str
) -> &mut Self
pub fn instance_export(
&mut self,
instance_index: u32,
kind: ExportKind,
name: &str
) -> &mut Self
Define an alias to an instance’s export.
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