Struct wasmparser::EventSectionReader
source · pub struct EventSectionReader<'a> { /* private fields */ }
Implementations§
source§impl<'a> EventSectionReader<'a>
impl<'a> EventSectionReader<'a>
pub fn new(data: &'a [u8], offset: usize) -> Result<EventSectionReader<'a>>
pub fn original_position(&self) -> usize
pub fn get_count(&self) -> u32
sourcepub fn read(&mut self) -> Result<EventType>
pub fn read(&mut self) -> Result<EventType>
Reads content of the event section.
Examples
use wasmparser::EventSectionReader;
let mut event_reader = EventSectionReader::new(data, 0).unwrap();
for _ in 0..event_reader.get_count() {
let et = event_reader.read().expect("event_type");
println!("Event: {:?}", et);
}
Trait Implementations§
source§impl<'a> Clone for EventSectionReader<'a>
impl<'a> Clone for EventSectionReader<'a>
source§fn clone(&self) -> EventSectionReader<'a>
fn clone(&self) -> EventSectionReader<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> IntoIterator for EventSectionReader<'a>
impl<'a> IntoIterator for EventSectionReader<'a>
§type Item = Result<EventType, BinaryReaderError>
type Item = Result<EventType, BinaryReaderError>
The type of the elements being iterated over.
§type IntoIter = SectionIteratorLimited<EventSectionReader<'a>>
type IntoIter = SectionIteratorLimited<EventSectionReader<'a>>
Which kind of iterator are we turning this into?
source§impl<'a> SectionReader for EventSectionReader<'a>
impl<'a> SectionReader for EventSectionReader<'a>
source§impl<'a> SectionWithLimitedItems for EventSectionReader<'a>
impl<'a> SectionWithLimitedItems for EventSectionReader<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for EventSectionReader<'a>
impl<'a> Send for EventSectionReader<'a>
impl<'a> Sync for EventSectionReader<'a>
impl<'a> Unpin for EventSectionReader<'a>
impl<'a> UnwindSafe for EventSectionReader<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more