Struct wasm_encoder::component::TypeSection [−][src]
pub struct TypeSection { /* fields omitted */ }
Expand description
An encoder for the component type section.
Example
use wasm_encoder::component::{Component, TypeSection, InterfaceType};
let mut types = TypeSection::new();
types.function(&[], &[]);
// list<u8>
let mut encoder = types.compound();
encoder.list(InterfaceType::U8);
// record { foo: list<u8> }
let mut encoder = types.compound();
encoder.record(&[("foo", InterfaceType::Compound(1))]);
let mut component = Component::new();
component.section(&types);
let bytes = component.finish();
Implementations
Define an instance type in this type section.
Define a module type in this type section.
Define a function type in this type section.
pub fn adapter_function(
&mut self,
params: &[(&str, InterfaceType)],
results: &[InterfaceType]
) -> &mut Self
pub fn adapter_function(
&mut self,
params: &[(&str, InterfaceType)],
results: &[InterfaceType]
) -> &mut Self
Define an adapter function type.
Define a compound type.
Trait Implementations
Returns the “default value” for a type. Read more
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