[][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<'c>(
    &mut self,
    resources: &dyn WasmModuleResources
) -> Result<Operator<'c>> where
    'b: 'c, 
[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 i = 0;
loop {
    {
        match *parser.read() {
            ParserState::Error(_) |
            ParserState::EndWasm => break,
            ParserState::BeginFunctionBody {..} => (),
            _ => continue
        }
    }
    let mut reader = parser.create_validating_operator_parser();
    println!("Function {}", i);
    i += 1;
    while !reader.eof() {
      let read = reader.next(parser.get_resources());
      if let Ok(ref op) = read {
          println!("  {:?}", op);
      } else {
          panic!("  Bad wasm code {:?}", read.err());
      }
    }
}

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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