[−][src]Struct wasm_encoder::TypeSection
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
impl TypeSection
[src]
pub fn new() -> TypeSection
[src]
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,
[src]
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,
[src]
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,
[src]
E: IntoIterator<Item = (&'a str, EntityType)>,
E::IntoIter: ExactSizeIterator,
Define an instance type.
Trait Implementations
impl Section for TypeSection
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,