Struct cranelift_wasm::wasmparser::RelocSectionReader
source · pub struct RelocSectionReader<'a> { /* private fields */ }
Expand description
A reader for the relocations custom section of a WebAssembly module.
Implementations§
source§impl<'a> RelocSectionReader<'a>
impl<'a> RelocSectionReader<'a>
sourcepub fn new(
data: &'a [u8],
offset: usize
) -> Result<RelocSectionReader<'a>, BinaryReaderError>
pub fn new(
data: &'a [u8],
offset: usize
) -> Result<RelocSectionReader<'a>, BinaryReaderError>
Constructs a new RelocSectionReader
for the given data and offset.
sourcepub fn get_section_code<'b>(&self) -> SectionCode<'b>where
'a: 'b,
pub fn get_section_code<'b>(&self) -> SectionCode<'b>where
'a: 'b,
Gets the section code from the section.
sourcepub fn original_position(&self) -> usize
pub fn original_position(&self) -> usize
Gets the original position of the reader.
sourcepub fn read(&mut self) -> Result<Reloc, BinaryReaderError>
pub fn read(&mut self) -> Result<Reloc, BinaryReaderError>
Reads an item from the reader.
Trait Implementations§
source§impl<'a> IntoIterator for RelocSectionReader<'a>
impl<'a> IntoIterator for RelocSectionReader<'a>
§type Item = Result<Reloc, BinaryReaderError>
type Item = Result<Reloc, BinaryReaderError>
The type of the elements being iterated over.
§type IntoIter = SectionIteratorLimited<RelocSectionReader<'a>>
type IntoIter = SectionIteratorLimited<RelocSectionReader<'a>>
Which kind of iterator are we turning this into?
source§fn into_iter(self) -> <RelocSectionReader<'a> as IntoIterator>::IntoIter
fn into_iter(self) -> <RelocSectionReader<'a> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
source§impl<'a> SectionReader for RelocSectionReader<'a>
impl<'a> SectionReader for RelocSectionReader<'a>
source§fn read(
&mut self
) -> Result<<RelocSectionReader<'a> as SectionReader>::Item, BinaryReaderError>
fn read(
&mut self
) -> Result<<RelocSectionReader<'a> as SectionReader>::Item, BinaryReaderError>
Reads an item from the section.
source§fn original_position(&self) -> usize
fn original_position(&self) -> usize
Gets the original position of the reader.
source§fn ensure_end(&self) -> Result<(), BinaryReaderError>
fn ensure_end(&self) -> Result<(), BinaryReaderError>
Ensures the reader is at the end of the section. Read more