libbpf_rs

Struct PerfBuffer

Source
pub struct PerfBuffer<'b> { /* private fields */ }
Expand description

Represents a special kind of MapCore. Typically used to transfer data between Programs and userspace.

Implementations§

Source§

impl PerfBuffer<'_>

Source

pub fn epoll_fd(&self) -> i32

Source

pub fn poll(&self, timeout: Duration) -> Result<()>

Source

pub fn consume(&self) -> Result<()>

Source

pub fn consume_buffer(&self, buf_idx: usize) -> Result<()>

Source

pub fn buffer_cnt(&self) -> usize

Source

pub fn buffer_fd(&self, buf_idx: usize) -> Result<i32>

Trait Implementations§

Source§

impl AsRawLibbpf for PerfBuffer<'_>

Source§

fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>

Retrieve the underlying libbpf_sys::perf_buffer.

Source§

type LibbpfType = perf_buffer

The underlying libbpf type.
Source§

impl<'b> Debug for PerfBuffer<'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for PerfBuffer<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for PerfBuffer<'_>

Auto Trait Implementations§

§

impl<'b> Freeze for PerfBuffer<'b>

§

impl<'b> !RefUnwindSafe for PerfBuffer<'b>

§

impl<'b> !Sync for PerfBuffer<'b>

§

impl<'b> Unpin for PerfBuffer<'b>

§

impl<'b> !UnwindSafe for PerfBuffer<'b>

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.