pub type ImportSectionReader<'a> = SectionLimited<'a, Import<'a>>;
Expand description
A reader for the import section of a WebAssembly module.
Aliased Type§
struct ImportSectionReader<'a> { /* private fields */ }
Implementations
Source§impl<'a, T> SectionLimited<'a, T>
impl<'a, T> SectionLimited<'a, T>
Sourcepub fn new(reader: BinaryReader<'a>) -> Result<Self>
pub fn new(reader: BinaryReader<'a>) -> Result<Self>
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
.
Sourcepub fn original_position(&self) -> usize
pub fn original_position(&self) -> usize
Returns whether the original byte offset of this section.
Sourcepub fn range(&self) -> Range<usize>
pub fn range(&self) -> Range<usize>
Returns the range, as byte offsets, of this section within the original wasm binary.
Sourcepub fn into_iter_with_offsets(self) -> SectionLimitedIntoIterWithOffsets<'a, T> ⓘwhere
T: FromReader<'a>,
pub fn into_iter_with_offsets(self) -> SectionLimitedIntoIterWithOffsets<'a, T> ⓘwhere
T: FromReader<'a>,
Returns an iterator which yields not only each item in this section but additionally the offset of each item within the section.