pub struct Module { /* private fields */ }
Expand description

WebAssembly module

Implementations

New module with sections

Construct a module from a slice.

Serialize a module to a vector.

Destructure the module, yielding sections

Version of module.

Sections list.

Each known section is optional and may appear at most once.

Sections list (mutable).

Each known section is optional and may appear at most once.

Insert a section, in the correct section ordering. This will fail with an error, if the section can only appear once.

Code section reference, if any.

Code section mutable reference, if any.

Types section reference, if any.

Types section mutable reference, if any.

Imports section reference, if any.

Imports section mutable reference, if any.

Globals section reference, if any.

Globals section mutable reference, if any.

Exports section reference, if any.

Exports section mutable reference, if any.

Table section reference, if any.

Table section mutable reference, if any.

Data section reference, if any.

Data section mutable reference, if any.

Element section reference, if any.

Element section mutable reference, if any.

Memory section reference, if any.

Memory section mutable reference, if any.

Functions signatures section reference, if any.

Functions signatures section mutable reference, if any.

Start section, if any.

Changes the module’s start section.

Removes the module’s start section.

Returns an iterator over the module’s custom sections

Sets the payload associated with the given custom section, or adds a new custom section, as appropriate.

Removes the given custom section, if it exists. Returns the removed section if it existed, or None otherwise.

True if a name section is present.

NOTE: this can return true even if the section was not parsed, hence names_section() may return None even if this returns true

Functions signatures section reference, if any.

NOTE: name section is not parsed by default so names_section could return None even if name section exists. Call parse_names to parse name section

Functions signatures section mutable reference, if any.

NOTE: name section is not parsed by default so names_section could return None even if name section exists. Call parse_names to parse name section

Try to parse name section in place.

Corresponding custom section with proper header will convert to name sections If some of them will fail to be decoded, Err variant is returned with the list of (index, Error) tuples of failed sections.

Try to parse reloc section in place.

Corresponding custom section with proper header will convert to reloc sections If some of them will fail to be decoded, Err variant is returned with the list of (index, Error) tuples of failed sections.

Count imports by provided type.

Query functions space.

Query globals space.

Query table space.

Query memory space.

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

Serialization error produced by deserialization routine.

Deserialize type from serial i/o

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialization error produced by serialization routine.

Serialize type to serial i/o

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.