Struct wasm_encoder::adapter::AliasSection
source · [−]pub struct AliasSection { /* private fields */ }
Expand description
An encoder for the adapter module alias section.
Example
use wasm_encoder::adapter::{AdapterModule, AliasSection, ExportKind};
let mut aliases = AliasSection::new();
aliases.outer_type(0, 2);
aliases.instance_export(0, ExportKind::Function, "foo");
let mut module = AdapterModule::new();
module.section(&aliases);
let bytes = module.finish();
Implementations
sourceimpl AliasSection
impl AliasSection
sourcepub fn instance_export(
&mut self,
instance: u32,
kind: ExportKind,
name: &str
) -> &mut Self
pub fn instance_export(
&mut self,
instance: u32,
kind: ExportKind,
name: &str
) -> &mut Self
Define an alias that references the export of a defined instance.
sourcepub fn outer_type(&mut self, count: u32, ty: u32) -> &mut Self
pub fn outer_type(&mut self, count: u32, ty: u32) -> &mut Self
Define an alias that references an outer module’s type.
sourcepub fn outer_module(&mut self, count: u32, module: u32) -> &mut Self
pub fn outer_module(&mut self, count: u32, module: u32) -> &mut Self
Define an alias that references an outer module’s module.
Trait Implementations
sourceimpl AdapterModuleSection for AliasSection
impl AdapterModuleSection for AliasSection
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