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
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more