[][src]Struct wasmparser::ValidatingOperatorParser

pub struct ValidatingOperatorParser<'b> { /* fields omitted */ }

Methods

impl<'b> ValidatingOperatorParser<'b>[src]

pub fn eof(&self) -> bool[src]

pub fn current_position(&self) -> usize[src]

pub fn is_dead_code(&self) -> bool[src]

pub fn next(
    &mut self,
    resources: &dyn WasmModuleResources
) -> Result<Operator<'b>>
[src]

Creates a BinaryReader when current state is ParserState::BeginSection or ParserState::BeginFunctionBody.

Examples

use wasmparser::{WasmDecoder, ParserState, ValidatingParser};
let mut parser = ValidatingParser::new(data, None);
let mut validating_parsers = Vec::new();
loop {
    {
        match *parser.read() {
            ParserState::Error(_) |
            ParserState::EndWasm => break,
            ParserState::BeginFunctionBody {..} => (),
            _ => continue
        }
    }
    let reader = parser.create_validating_operator_parser();
    validating_parsers.push(reader);
}
for (i, reader) in validating_parsers.iter_mut().enumerate() {
    println!("Function {}", i);
    while !reader.eof() {
      let read = reader.next(&parser);
      if let Ok(ref op) = read {
          println!("  {:?}", op);
      } else {
          panic!("  Bad wasm code {:?}", read.err());
      }
    }
}

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.