linera_wasmer_compiler

Trait 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§