Struct wasmtime_environ::wasm::wasmparser::OperatorsReader [−][src]
Implementations
impl<'a> OperatorsReader<'a>
[src]
pub fn eof(&self) -> bool
[src]
pub fn original_position(&self) -> usize
[src]
pub fn ensure_end(&self) -> Result<(), BinaryReaderError>
[src]
pub fn read<'b>(&mut self) -> Result<Operator<'b>, BinaryReaderError> where
'a: 'b,
[src]
'a: 'b,
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,
[src]
Notable traits for OperatorsIteratorWithOffsets<'a>
impl<'a> Iterator for OperatorsIteratorWithOffsets<'a> type Item = Result<(Operator<'a>, usize), BinaryReaderError>;
'a: 'b,
pub fn read_with_offset<'b>(
&mut self
) -> Result<(Operator<'b>, usize), BinaryReaderError> where
'a: 'b,
[src]
&mut self
) -> Result<(Operator<'b>, usize), BinaryReaderError> where
'a: 'b,
Trait Implementations
impl<'a> Clone for OperatorsReader<'a>
[src]
pub fn clone(&self) -> OperatorsReader<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> IntoIterator for OperatorsReader<'a>
[src]
type Item = Result<Operator<'a>, BinaryReaderError>
The type of the elements being iterated over.
type IntoIter = OperatorsIterator<'a>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <OperatorsReader<'a> as IntoIterator>::IntoIter
[src]
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 ); }
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,