[][src]Struct solana_rbpf::insn_builder::BpfCode

pub struct BpfCode { /* fields omitted */ }

BPF instruction stack in byte representation

Methods

impl BpfCode[src]

pub fn new() -> Self[src]

creates new empty BPF instruction stack

pub fn add(&mut self, source: Source, arch: Arch) -> Move[src]

create ADD instruction

pub fn sub(&mut self, source: Source, arch: Arch) -> Move[src]

create SUB instruction

pub fn mul(&mut self, source: Source, arch: Arch) -> Move[src]

create MUL instruction

pub fn div(&mut self, source: Source, arch: Arch) -> Move[src]

create DIV instruction

pub fn bit_or(&mut self, source: Source, arch: Arch) -> Move[src]

create OR instruction

pub fn bit_and(&mut self, source: Source, arch: Arch) -> Move[src]

create AND instruction

pub fn left_shift(&mut self, source: Source, arch: Arch) -> Move[src]

create LSHIFT instruction

pub fn right_shift(&mut self, source: Source, arch: Arch) -> Move[src]

create RSHIFT instruction

pub fn negate(&mut self, arch: Arch) -> Move[src]

create NEGATE instruction

pub fn modulo(&mut self, source: Source, arch: Arch) -> Move[src]

create MOD instruction

pub fn bit_xor(&mut self, source: Source, arch: Arch) -> Move[src]

create XOR instruction

pub fn mov(&mut self, source: Source, arch: Arch) -> Move[src]

create MOV instruction

pub fn signed_right_shift(&mut self, source: Source, arch: Arch) -> Move[src]

create SIGNED RSHIFT instruction

pub fn swap_bytes(&mut self, endian: Endian) -> SwapBytes[src]

create byte swap instruction

pub fn load(&mut self, mem_size: MemSize) -> Load[src]

create LOAD instruction, IMMEDIATE is the source

pub fn load_abs(&mut self, mem_size: MemSize) -> Load[src]

create ABSOLUTE LOAD instruction

pub fn load_ind(&mut self, mem_size: MemSize) -> Load[src]

create INDIRECT LOAD instruction

pub fn load_x(&mut self, mem_size: MemSize) -> Load[src]

create LOAD instruction, MEMORY is the source

pub fn store(&mut self, mem_size: MemSize) -> Store[src]

creates STORE instruction, IMMEDIATE is the source

pub fn store_x(&mut self, mem_size: MemSize) -> Store[src]

creates STORE instruction, MEMORY is the source

pub fn jump_unconditional(&mut self) -> Jump[src]

create unconditional JMP instruction

pub fn jump_conditional(&mut self, cond: Cond, src_bit: Source) -> Jump[src]

create conditional JMP instruction

pub fn call(&mut self) -> FunctionCall[src]

create CALL instruction

pub fn exit(&mut self) -> Exit[src]

create EXIT instruction

Trait Implementations

impl Default for BpfCode[src]

impl<'a> IntoBytes for &'a BpfCode[src]

Transform BpfCode into assemble representation

type Bytes = &'a [u8]

type of targeted transformation

fn into_bytes(self) -> Self::Bytes[src]

returns BpfCode instruction stack as &[u8]

Auto Trait Implementations

impl RefUnwindSafe for BpfCode

impl Send for BpfCode

impl Sync for BpfCode

impl Unpin for BpfCode

impl UnwindSafe for BpfCode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.