Struct wasm_encoder::Module
source · pub struct Module { /* private fields */ }
Expand description
Represents a WebAssembly component that is being encoded.
Sections within a WebAssembly module are encoded in a specific order.
Modules may also added as a section to a WebAssembly component.
Implementations§
source§impl Module
impl Module
sourcepub fn section(&mut self, section: &impl Section) -> &mut Self
pub fn section(&mut self, section: &impl Section) -> &mut Self
Write a section into this module.
It is your responsibility to define the sections in the proper order, and to ensure that each kind of section (other than custom sections) is only defined once. While this is a potential footgun, it also allows you to use this crate to easily construct test cases for bad Wasm module encodings.