Struct wasmparser::ExportSectionReader
source · pub struct ExportSectionReader<'a> { /* private fields */ }
Implementations
sourceimpl<'a> ExportSectionReader<'a>
impl<'a> ExportSectionReader<'a>
pub fn new(data: &'a [u8], offset: usize) -> Result<ExportSectionReader<'a>>
pub fn original_position(&self) -> usize
pub fn get_count(&self) -> u32
sourcepub fn read<'b>(&mut self) -> Result<Export<'b>>where
'a: 'b,
pub fn read<'b>(&mut self) -> Result<Export<'b>>where
'a: 'b,
Reads content of the export section.
Examples
use wasmparser::ModuleReader;
let mut reader = ModuleReader::new(data).expect("module reader");
let section = reader.read().expect("type section");
let section = reader.read().expect("function section");
let section = reader.read().expect("export section");
let mut export_reader = section.get_export_section_reader().expect("export section reader");
for _ in 0..export_reader.get_count() {
let export = export_reader.read().expect("export");
println!("Export: {:?}", export);
}
Trait Implementations
sourceimpl<'a> IntoIterator for ExportSectionReader<'a>
impl<'a> IntoIterator for ExportSectionReader<'a>
type Item = Result<Export<'a>, BinaryReaderError>
type Item = Result<Export<'a>, BinaryReaderError>
The type of the elements being iterated over.
type IntoIter = SectionIteratorLimited<ExportSectionReader<'a>>
type IntoIter = SectionIteratorLimited<ExportSectionReader<'a>>
Which kind of iterator are we turning this into?
sourceimpl<'a> SectionReader for ExportSectionReader<'a>
impl<'a> SectionReader for ExportSectionReader<'a>
sourceimpl<'a> SectionWithLimitedItems for ExportSectionReader<'a>
impl<'a> SectionWithLimitedItems for ExportSectionReader<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ExportSectionReader<'a>
impl<'a> Send for ExportSectionReader<'a>
impl<'a> Sync for ExportSectionReader<'a>
impl<'a> Unpin for ExportSectionReader<'a>
impl<'a> UnwindSafe for ExportSectionReader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more