[−][src]Struct wasmparser::ModuleReader
Reads top-level WebAssembly file structure: header and sections.
Methods
impl<'a> ModuleReader<'a>
[src]
pub fn new(data: &[u8]) -> Result<ModuleReader>
[src]
pub fn get_version(&self) -> u32
[src]
pub fn current_position(&self) -> usize
[src]
pub fn eof(&self) -> bool
[src]
pub fn read<'b>(&mut self) -> Result<Section<'b>> where
'a: 'b,
[src]
'a: 'b,
Reads next top-level record from the WebAssembly binary data. The methods returns reference to current state of the reader.
Examples
use wasmparser::ModuleReader; let mut reader = ModuleReader::new(data).expect("reader"); let section = reader.read().expect("section #1"); println!("First section {:?}", section); let section = reader.read().expect("section #2"); println!("Second section {:?}", section); assert!(!reader.eof(), "there are more sections");
pub fn skip_custom_sections(&mut self) -> Result<()>
[src]
Skips custom sections.
Examples
use wasmparser::ModuleReader; use wasmparser::SectionCode; let mut reader = ModuleReader::new(data).expect("reader"); while { reader.skip_custom_sections(); !reader.eof() } { let section = reader.read().expect("section"); if let SectionCode::Custom {..} = section.code { panic!("no custom"); } println!("Section {:?}", section); }
Trait Implementations
impl<'a> IntoIterator for ModuleReader<'a>
[src]
Auto Trait Implementations
impl<'a> Send for ModuleReader<'a>
impl<'a> Sync for ModuleReader<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,