Struct wasmtime_environ::wasmparser::OperatorsReader [−][src]
pub struct OperatorsReader<'a> { /* fields omitted */ }
Implementations
pub fn into_iter_with_offsets<'b>(self) -> OperatorsIteratorWithOffsets<'b>ⓘNotable traits for OperatorsIteratorWithOffsets<'a>impl<'a> Iterator for OperatorsIteratorWithOffsets<'a> type Item = Result<(Operator<'a>, usize), BinaryReaderError>;
where
'a: 'b,
Notable traits for OperatorsIteratorWithOffsets<'a>
impl<'a> Iterator for OperatorsIteratorWithOffsets<'a> type Item = Result<(Operator<'a>, usize), BinaryReaderError>;
pub fn read_with_offset<'b>(
&mut self
) -> Result<(Operator<'b>, usize), BinaryReaderError> where
'a: 'b,
Trait Implementations
Reads content of the code section.
Examples
use wasmparser::{Operator, CodeSectionReader, Result};
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 op_reader = body.get_operators_reader().expect("op reader");
let ops = op_reader.into_iter().collect::<Result<Vec<Operator>>>().expect("ops");
assert!(
if let [Operator::Nop, Operator::End] = ops.as_slice() { true } else { false },
"found {:?}",
ops
);
}
type Item = Result<Operator<'a>, BinaryReaderError>
type Item = Result<Operator<'a>, BinaryReaderError>
The type of the elements being iterated over.
type IntoIter = OperatorsIterator<'a>
type IntoIter = OperatorsIterator<'a>
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl<'a> RefUnwindSafe for OperatorsReader<'a>
impl<'a> Send for OperatorsReader<'a>
impl<'a> Sync for OperatorsReader<'a>
impl<'a> Unpin for OperatorsReader<'a>
impl<'a> UnwindSafe for OperatorsReader<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more