Trait Instruction

Source
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

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§