Struct wasm_encoder::ComponentExportSection
source · pub struct ComponentExportSection { /* private fields */ }
Expand description
An encoder for the export section of WebAssembly component.
§Example
use wasm_encoder::{Component, ComponentExportSection, ComponentExportKind};
// This exports a function named "foo"
let mut exports = ComponentExportSection::new();
exports.export("foo", ComponentExportKind::Func, 0, None);
let mut component = Component::new();
component.section(&exports);
let bytes = component.finish();
Implementations§
source§impl ComponentExportSection
impl ComponentExportSection
sourcepub fn export(
&mut self,
name: &str,
kind: ComponentExportKind,
index: u32,
ty: Option<ComponentTypeRef>,
) -> &mut Self
pub fn export( &mut self, name: &str, kind: ComponentExportKind, index: u32, ty: Option<ComponentTypeRef>, ) -> &mut Self
Define an export in the export section.
Trait Implementations§
source§impl Clone for ComponentExportSection
impl Clone for ComponentExportSection
source§fn clone(&self) -> ComponentExportSection
fn clone(&self) -> ComponentExportSection
Returns a copy 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 Debug for ComponentExportSection
impl Debug for ComponentExportSection
source§impl Default for ComponentExportSection
impl Default for ComponentExportSection
source§fn default() -> ComponentExportSection
fn default() -> ComponentExportSection
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComponentExportSection
impl RefUnwindSafe for ComponentExportSection
impl Send for ComponentExportSection
impl Sync for ComponentExportSection
impl Unpin for ComponentExportSection
impl UnwindSafe for ComponentExportSection
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)