pub struct ComponentExportSection { /* private fields */ }
Available on crate feature
component-model
only.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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)