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

Begin writing a new Module.

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.

Get the encoded Wasm module as a slice.

Finish writing this Wasm module and extract ownership of the encoded bytes.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.