pub trait IntoBytes {
    type Bytes;

    // Required method
    fn into_bytes(self) -> Self::Bytes;
}
Expand description

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

Required Associated Types§

source

type Bytes

type of targeted transformation

Required Methods§

source

fn into_bytes(self) -> Self::Bytes

consume Self with transformation into Self::Bytes

Implementations on Foreign Types§

source§

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

General implementation of IntoBytes for Instruction

source§

fn into_bytes(self) -> Self::Bytes

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 ]

§

type Bytes = Vec<u8>

Implementors§

source§

impl<'a> IntoBytes for &'a BpfCode

Transform BpfCode into assemble representation

§

type Bytes = &'a [u8]