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
sourceimpl 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
sourceimpl Clone for CanonicalFunctionSection
impl Clone for CanonicalFunctionSection
sourcefn clone(&self) -> CanonicalFunctionSection
fn clone(&self) -> CanonicalFunctionSection
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 moresourceimpl Debug for CanonicalFunctionSection
impl Debug for CanonicalFunctionSection
sourceimpl Default for CanonicalFunctionSection
impl Default for CanonicalFunctionSection
sourcefn default() -> CanonicalFunctionSection
fn default() -> CanonicalFunctionSection
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CanonicalFunctionSection
impl Send for CanonicalFunctionSection
impl Sync for CanonicalFunctionSection
impl Unpin for CanonicalFunctionSection
impl UnwindSafe for CanonicalFunctionSection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more