Trait solana_rbpf::insn_builder::IntoBytes[][src]

pub trait IntoBytes {
    type Bytes;
    fn into_bytes(self) -> Self::Bytes;
}
[]

General trait for Instructions and BpfCode. Provides functionality to transform struct into collection of bytes

Associated Types

type Bytes[src][]

type of targeted transformation

Required methods

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

consume Self with transformation into Self::Bytes

Implementations on Foreign Types

impl<'i, I: Instruction> IntoBytes for &'i I[src][]

[]

General implementation of IntoBytes for Instruction

type Bytes = Vec<u8>

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

transform immutable reference of Instruction into Vec<u8> with size of 8 [ 1 byte , 1 byte , 2 bytes, 4 bytes ] [ OP_CODE, SRC_REG | DST_REG, OFFSET , IMMEDIATE ]

Implementors

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

Transform BpfCode into assemble representation

type Bytes = &'a [u8]

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

returns BpfCode instruction stack as &[u8]