pub trait Instruction: Sized {
    // Required methods
    fn opt_code_byte(&self) -> u8;
    fn get_insn(&self) -> &Insn;
    fn get_insn_mut(&mut self) -> &mut Insn;

    // Provided methods
    fn get_dst(&self) -> u8 { ... }
    fn get_src(&self) -> u8 { ... }
    fn get_off(&self) -> i16 { ... }
    fn get_imm(&self) -> i64 { ... }
    fn set_dst(self, dst: u8) -> Self { ... }
    fn set_src(self, src: u8) -> Self { ... }
    fn set_off(self, offset: i16) -> Self { ... }
    fn set_imm(self, imm: i64) -> Self { ... }
}
Expand description

Represents single eBPF instruction

Required Methods§

source

fn opt_code_byte(&self) -> u8

returns instruction opt code

source

fn get_insn(&self) -> &Insn

get ebpf::Insn struct

source

fn get_insn_mut(&mut self) -> &mut Insn

get mutable ebpf::Insn struct

Provided Methods§

source

fn get_dst(&self) -> u8

returns destination register

source

fn get_src(&self) -> u8

returns source register

source

fn get_off(&self) -> i16

returns offset bytes

source

fn get_imm(&self) -> i64

returns immediate value

source

fn set_dst(self, dst: u8) -> Self

sets destination register

source

fn set_src(self, src: u8) -> Self

sets source register

source

fn set_off(self, offset: i16) -> Self

sets offset bytes

source

fn set_imm(self, imm: i64) -> Self

sets immediate value

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'i> Instruction for Exit<'i>

source§

impl<'i> Instruction for FunctionCall<'i>

source§

impl<'i> Instruction for Jump<'i>

source§

impl<'i> Instruction for Load<'i>

source§

impl<'i> Instruction for Move<'i>

source§

impl<'i> Instruction for Store<'i>

source§

impl<'i> Instruction for SwapBytes<'i>