Struct holochain_wasmer_host::prelude::wasmparser::CodeSectionReader[]

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

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

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.