Struct wasm_encoder::TypeSection [−][src]
pub struct TypeSection { /* fields omitted */ }
Expand description
An encoder for the type section.
Example
use wasm_encoder::{Module, TypeSection, ValType}; let mut types = TypeSection::new(); let params = vec![ValType::I32, ValType::I64]; let results = vec![ValType::I32]; types.function(params, results); let mut module = Module::new(); module.section(&types); let wasm_bytes = module.finish();
Implementations
Create a new type section encoder.
pub fn function<P, R>(&mut self, params: P, results: R) -> &mut Self where
P: IntoIterator<Item = ValType>,
P::IntoIter: ExactSizeIterator,
R: IntoIterator<Item = ValType>,
R::IntoIter: ExactSizeIterator,
pub fn function<P, R>(&mut self, params: P, results: R) -> &mut Self where
P: IntoIterator<Item = ValType>,
P::IntoIter: ExactSizeIterator,
R: IntoIterator<Item = ValType>,
R::IntoIter: ExactSizeIterator,
Define a function type.
pub fn module<'a, I, E>(&mut self, imports: I, exports: E) -> &mut Self where
I: IntoIterator<Item = (&'a str, Option<&'a str>, EntityType)>,
I::IntoIter: ExactSizeIterator,
E: IntoIterator<Item = (&'a str, EntityType)>,
E::IntoIter: ExactSizeIterator,
pub fn module<'a, I, E>(&mut self, imports: I, exports: E) -> &mut Self where
I: IntoIterator<Item = (&'a str, Option<&'a str>, EntityType)>,
I::IntoIter: ExactSizeIterator,
E: IntoIterator<Item = (&'a str, EntityType)>,
E::IntoIter: ExactSizeIterator,
Define a module type.
pub fn instance<'a, E>(&mut self, exports: E) -> &mut Self where
E: IntoIterator<Item = (&'a str, EntityType)>,
E::IntoIter: ExactSizeIterator,
pub fn instance<'a, E>(&mut self, exports: E) -> &mut Self where
E: IntoIterator<Item = (&'a str, EntityType)>,
E::IntoIter: ExactSizeIterator,
Define an instance type.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TypeSection
impl Send for TypeSection
impl Sync for TypeSection
impl Unpin for TypeSection
impl UnwindSafe for TypeSection
Blanket Implementations
Mutably borrows from an owned value. Read more