pub struct BpfSkeleton { /* private fields */ }
Expand description

Represents a polling-ready bpf skeleton. With you can control the ebpf program and poll from it.

Implementations§

source§

impl BpfSkeleton

source

pub fn create_poll_handle(&self) -> PollingHandle

Create a poll handle to control the poll progress You can create multiple ones. All handles have the same ability

source

pub fn get_program_name(&self) -> &str

Get the name of the loaded program

source

pub fn get_map_fd(&self, name: impl AsRef<str>) -> Option<i32>

Get the fd of the provided map returns None if not found

source

pub fn get_prog_fd(&self, name: impl AsRef<str>) -> Option<i32>

Get the fd of the provided program returns None if not found

source

pub fn wait_and_poll_to_handler( &self, export_format_type: ExportFormatType, export_event_handler: Option<Arc<dyn EventHandler>>, user_context: Option<Arc<dyn Any>> ) -> Result<()>

@brief auto polling and export the data to user space handler @details The key of the value is the field name in the export json. This function will block the current thread and poll If you want to control the poller, just create a handle using create_poll_handle before calling this. Note: this function will set paused and terminating to false before polling.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.