Skip to main content

Immediates

Trait Immediates 

Source
pub trait Immediates {
    // Required methods
    fn read_u16(&self) -> u16;
    fn read_u8(&self) -> u8;
    fn read_offset_u16(&self, offset: isize) -> u16;
    fn read_slice(&self, len: usize) -> &[u8] ;

    // Provided methods
    fn read_i16(&self) -> i16 { ... }
    fn read_i8(&self) -> i8 { ... }
    fn read_offset_i16(&self, offset: isize) -> i16 { ... }
}
Expand description

Helper function to read immediates data from the bytecode

Required Methods§

Source

fn read_u16(&self) -> u16

Reads next 16 bits as unsigned integer from the bytecode.

Source

fn read_u8(&self) -> u8

Reads next 8 bits as unsigned integer from the bytecode.

Source

fn read_offset_u16(&self, offset: isize) -> u16

Reads next 16 bits as unsigned integer from the bytecode at given offset.

Source

fn read_slice(&self, len: usize) -> &[u8]

Reads next len bytes from the bytecode.

Used by PUSH opcode.

Provided Methods§

Source

fn read_i16(&self) -> i16

Reads next 16 bits as signed integer from the bytecode.

Source

fn read_i8(&self) -> i8

Reads next 8 bits as signed integer from the bytecode.

Source

fn read_offset_i16(&self, offset: isize) -> i16

Reads next 16 bits as signed integer from the bytecode at given offset.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§