pub struct SectionLimited<'a, T> { /* private fields */ }
Expand description

A generic structure for reading a section of a WebAssembly binary which has a limited number of items within it.

Many WebAssembly sections are a count of items followed by that many items. This helper structure can be used to parse these sections and provides an iteration-based API for reading the contents.

Note that this always implements the Clone trait to represent the ability to parse the section multiple times.

Implementations§

Creates a new section reader from the provided contents.

The data provided here is the data of the section itself that will be parsed. The offset argument is the byte offset, in the original wasm binary, that the section was found. The offset argument is used for error reporting.

Errors

Returns an error if a 32-bit count couldn’t be read from the data.

Returns the count of total items within this section.

Returns whether the original byte offset of this section.

Returns the range, as byte offsets, of this section within the original wasm binary.

Returns an iterator which yields not only each item in this section but additionally the offset of each item within the section.

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
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. 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.