Struct wasm_encoder::CanonicalFunctionSection
source · pub struct CanonicalFunctionSection { /* private fields */ }
Expand description
An encoder for the canonical function section of WebAssembly components.
Example
use wasm_encoder::{Component, CanonicalFunctionSection, CanonicalOption};
let mut functions = CanonicalFunctionSection::new();
functions.lift(0, 0, [CanonicalOption::UTF8]);
let mut component = Component::new();
component.section(&functions);
let bytes = component.finish();
Implementations§
source§impl CanonicalFunctionSection
impl CanonicalFunctionSection
sourcepub fn lift<O>(
&mut self,
core_func_index: u32,
type_index: u32,
options: O
) -> &mut Selfwhere
O: IntoIterator<Item = CanonicalOption>,
O::IntoIter: ExactSizeIterator,
pub fn lift<O>( &mut self, core_func_index: u32, type_index: u32, options: O ) -> &mut Selfwhere O: IntoIterator<Item = CanonicalOption>, O::IntoIter: ExactSizeIterator,
Define a function that will lift a core WebAssembly function to the canonical ABI.
sourcepub fn lower<O>(&mut self, func_index: u32, options: O) -> &mut Selfwhere
O: IntoIterator<Item = CanonicalOption>,
O::IntoIter: ExactSizeIterator,
pub fn lower<O>(&mut self, func_index: u32, options: O) -> &mut Selfwhere O: IntoIterator<Item = CanonicalOption>, O::IntoIter: ExactSizeIterator,
Define a function that will lower a canonical ABI function to a core WebAssembly function.
Trait Implementations§
source§impl Clone for CanonicalFunctionSection
impl Clone for CanonicalFunctionSection
source§fn clone(&self) -> CanonicalFunctionSection
fn clone(&self) -> CanonicalFunctionSection
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 CanonicalFunctionSection
impl Debug for CanonicalFunctionSection
source§impl Default for CanonicalFunctionSection
impl Default for CanonicalFunctionSection
source§fn default() -> CanonicalFunctionSection
fn default() -> CanonicalFunctionSection
Returns the “default value” for a type. Read more