Struct BpfSkeleton

Source
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_with_multiple_exporter( &self, exporter_provider: impl Fn(&str) -> Option<(ExportFormatType, Arc<dyn EventHandler>, Option<Arc<dyn Any>>)>, ) -> Result<()>

Start poll with each map corresponding to a different exporter The function exporter_provider should return the ExportFormatType, EventHandler, and UserContext(if applies) for the given map name (If you want to set the exporter)

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.