Trait wasmer_compiler::FunctionBinaryReader

source ·
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§

source

fn read_local_count(&mut self) -> WasmResult<u32>

Read a count indicating the number of times to call read_local_decl.

source

fn read_local_decl(&mut self) -> WasmResult<(u32, ValType)>

Read a (count, value_type) declaration of local variables of the same type.

source

fn read_operator(&mut self) -> WasmResult<Operator<'a>>

Reads the next available Operator.

source

fn current_position(&self) -> usize

Returns the current position.

source

fn original_position(&self) -> usize

Returns the original position (with the offset)

source

fn bytes_remaining(&self) -> usize

Returns the number of bytes remaining.

source

fn eof(&self) -> bool

Returns whether the readers has reached the end of the file.

source

fn range(&self) -> Range<usize>

Return the range (original offset, original offset + data length)

Implementors§