Struct wasmparser::CodeSectionReader[][src]

pub struct CodeSectionReader<'a> { /* fields omitted */ }

Implementations

Reads content of the code section.

Examples
use wasmparser::CodeSectionReader;
let mut code_reader = CodeSectionReader::new(data, 0).unwrap();
for _ in 0..code_reader.get_count() {
    let body = code_reader.read().expect("function body");
    let mut binary_reader = body.get_binary_reader();
    assert!(binary_reader.read_var_u32().expect("local count") == 0);
    let op = binary_reader.read_operator().expect("first operator");
    println!("First operator: {:?}", op);
}

Trait Implementations

Implements iterator over the code section.

Examples
use wasmparser::CodeSectionReader;
let mut code_reader = CodeSectionReader::new(data, 0).unwrap();
for body in code_reader {
    let mut binary_reader = body.expect("b").get_binary_reader();
    assert!(binary_reader.read_var_u32().expect("local count") == 0);
    let op = binary_reader.read_operator().expect("first operator");
    println!("First operator: {:?}", op);
}

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.