Skip to main content

EbpfInst

Trait EbpfInst 

Source
pub trait EbpfInst: Clone {
    // Required methods
    fn opc(&self) -> u8;
    fn imm(&self) -> i32;
    fn src(&self) -> u8;
    fn set_imm(&mut self, imm: i32);
    fn to_array(&self) -> [u8; 8];
}
Expand description

Trait for eBPF instructions that can be processed by the preprocessor.

Required Methods§

Source

fn opc(&self) -> u8

Get the opcode of the instruction.

Source

fn imm(&self) -> i32

Get the destination register of the instruction.

Source

fn src(&self) -> u8

Get the source register of the instruction.

Source

fn set_imm(&mut self, imm: i32)

set the immediate value of the instruction.

Source

fn to_array(&self) -> [u8; 8]

Convert the instruction to a byte array.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§