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.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more