pub struct ModuleReader<'a> { /* fields omitted */ }
Reads top-level WebAssembly file structure: header and sections.
Reads next top-level record from the WebAssembly binary data.
The methods returns reference to current state of the reader.
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");
Skips custom sections.
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);
}
The type of the elements being iterated over.
type IntoIter = ModuleIterator<'a>
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more