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

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

type of targeted transformation

Loading content...

Required methods

fn into_bytes(self) -> Self::Bytes

consume Self with transformation into Self::Bytes

Loading content...

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 ]

Loading content...

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]

Loading content...