pub struct ComponentAliasSection { /* private fields */ }
Expand description
An encoder for the alias section of WebAssembly component.
§Example
use wasm_encoder::{Component, Alias, ComponentAliasSection, ComponentExportKind, ComponentOuterAliasKind};
let mut aliases = ComponentAliasSection::new();
aliases.alias(Alias::InstanceExport { instance: 0, kind: ComponentExportKind::Func, name: "f" });
aliases.alias(Alias::Outer { count: 0, kind: ComponentOuterAliasKind::Type, index: 1 });
let mut component = Component::new();
component.section(&aliases);
let bytes = component.finish();
Implementations§
Source§impl ComponentAliasSection
impl ComponentAliasSection
Sourcepub fn new() -> Self
Available on crate feature component-model
only.
pub fn new() -> Self
component-model
only.Create a new alias section encoder.
Sourcepub fn len(&self) -> u32
Available on crate feature component-model
only.
pub fn len(&self) -> u32
component-model
only.The number of aliases in the section.
Trait Implementations§
Source§impl Clone for ComponentAliasSection
Available on crate feature component-model
only.
impl Clone for ComponentAliasSection
Available on crate feature
component-model
only.Source§fn clone(&self) -> ComponentAliasSection
fn clone(&self) -> ComponentAliasSection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl ComponentSection for ComponentAliasSection
Available on crate feature component-model
only.
impl ComponentSection for ComponentAliasSection
Available on crate feature
component-model
only.Source§impl Debug for ComponentAliasSection
Available on crate feature component-model
only.
impl Debug for ComponentAliasSection
Available on crate feature
component-model
only.Source§impl Default for ComponentAliasSection
Available on crate feature component-model
only.
impl Default for ComponentAliasSection
Available on crate feature
component-model
only.Source§fn default() -> ComponentAliasSection
fn default() -> ComponentAliasSection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComponentAliasSection
impl RefUnwindSafe for ComponentAliasSection
impl Send for ComponentAliasSection
impl Sync for ComponentAliasSection
impl Unpin for ComponentAliasSection
impl UnwindSafe for ComponentAliasSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more