[][src]Struct redbpf::ProgramArray

pub struct ProgramArray<'a> { /* fields omitted */ }

Program array map.

An array of eBPF programs that can be used as a jump table.

To use this from eBPF code, see redbpf_probes::maps::ProgramArray.


impl<'base> ProgramArray<'base>[src]

pub fn new(base: &Map) -> Result<ProgramArray<'_>>[src]

pub fn get(&self, index: u32) -> Result<RawFd>[src]

Get the fd of the eBPF program at index.

pub fn set(&mut self, index: u32, fd: RawFd) -> Result<()>[src]

Set the index entry to the given eBPF program fd.

To jump to a program from eBPF, see redbpf_probes::maps::ProgramArray::tail_call.


pub const PROGRAM_PARSE_HTTP: u32 = 0;

use redbpf::{load::Loader, ProgramArray};
let mut loader = Loader::load_file("iotop.elf").expect("error loading probe");
let mut programs = ProgramArray::new(loader.map("program_map").unwrap()).unwrap();


Auto Trait Implementations

impl<'a> RefUnwindSafe for ProgramArray<'a>

impl<'a> Send for ProgramArray<'a>

impl<'a> Sync for ProgramArray<'a>

impl<'a> Unpin for ProgramArray<'a>

impl<'a> UnwindSafe for ProgramArray<'a>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.