Struct wasmparser::ElementSectionReader [−][src]
pub struct ElementSectionReader<'a> { /* fields omitted */ }
Implementations
impl<'a> ElementSectionReader<'a>
[src]
impl<'a> ElementSectionReader<'a>
[src]pub fn new(data: &'a [u8], offset: usize) -> Result<ElementSectionReader<'a>>
[src]
pub fn original_position(&self) -> usize
[src]
pub fn get_count(&self) -> u32
[src]
pub fn read<'b>(&mut self) -> Result<Element<'b>> where
'a: 'b,
[src]
'a: 'b,
Reads content of the element section.
Examples
use wasmparser::{ElementSectionReader, ElementKind}; let mut element_reader = ElementSectionReader::new(data, 0).unwrap(); for _ in 0..element_reader.get_count() { let element = element_reader.read().expect("element"); if let ElementKind::Active { init_expr, .. } = element.kind { let mut init_expr_reader = init_expr.get_binary_reader(); let op = init_expr_reader.read_operator().expect("op"); println!("Init const: {:?}", op); } let mut items_reader = element.items.get_items_reader().expect("items reader"); for _ in 0..items_reader.get_count() { let item = items_reader.read().expect("item"); println!(" Item: {:?}", item); } }
Trait Implementations
impl<'a> Clone for ElementSectionReader<'a>
[src]
impl<'a> Clone for ElementSectionReader<'a>
[src]fn clone(&self) -> ElementSectionReader<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> IntoIterator for ElementSectionReader<'a>
[src]
impl<'a> IntoIterator for ElementSectionReader<'a>
[src]type Item = Result<Element<'a>>
The type of the elements being iterated over.
type IntoIter = SectionIteratorLimited<ElementSectionReader<'a>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> SectionReader for ElementSectionReader<'a>
[src]
impl<'a> SectionReader for ElementSectionReader<'a>
[src]impl<'a> SectionWithLimitedItems for ElementSectionReader<'a>
[src]
impl<'a> SectionWithLimitedItems for ElementSectionReader<'a>
[src]