pub trait FunctionBinaryReader<'a> {
// Required methods
fn read_local_count(&mut self) -> WasmResult<u32>;
fn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>;
fn read_operator(&mut self) -> WasmResult<Operator<'a>>;
fn current_position(&self) -> usize;
fn original_position(&self) -> usize;
fn bytes_remaining(&self) -> usize;
fn eof(&self) -> bool;
fn range(&self) -> Range<usize>;
}
Expand description
Trait for iterating over the operators of a Wasm Function
Required Methods§
sourcefn read_local_count(&mut self) -> WasmResult<u32>
fn read_local_count(&mut self) -> WasmResult<u32>
Read a count
indicating the number of times to call read_local_decl
.
sourcefn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>
fn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>
Read a (count, value_type)
declaration of local variables of the same type.
sourcefn read_operator(&mut self) -> WasmResult<Operator<'a>>
fn read_operator(&mut self) -> WasmResult<Operator<'a>>
Reads the next available Operator
.
sourcefn current_position(&self) -> usize
fn current_position(&self) -> usize
Returns the current position.
sourcefn original_position(&self) -> usize
fn original_position(&self) -> usize
Returns the original position (with the offset)
sourcefn bytes_remaining(&self) -> usize
fn bytes_remaining(&self) -> usize
Returns the number of bytes remaining.