[][src]Struct libbpf_rs::PerfBufferBuilder

pub struct PerfBufferBuilder<'a, F, G> where
    F: FnMut(i32, &[u8]) + 'static,
    G: FnMut(i32, u64) + 'static, 
{ /* fields omitted */ }

Builds PerfBuffer instances.

Implementations

impl<'a, F, G> PerfBufferBuilder<'a, F, G> where
    F: FnMut(i32, &[u8]) + 'static,
    G: FnMut(i32, u64) + 'static, 
[src]

pub fn new(map: &'a Map) -> Self[src]

pub fn set_sample_cb(&mut self, cb: F) -> &mut Self[src]

Callback to run when a sample is received.

This callback provides a raw byte slice. You may find libraries such as plain helpful.

Callback arguments are: (cpu, data).

pub fn set_lost_cb(&mut self, cb: G) -> &mut Self[src]

Callback to run when a sample is received.

Callback arguments are: (cpu, lost_count).

pub fn set_pages(&mut self, pages: usize) -> &mut Self[src]

The number of pages to size the ring buffer.

pub fn build(self) -> Result<PerfBuffer>[src]

Auto Trait Implementations

impl<'a, F, G> RefUnwindSafe for PerfBufferBuilder<'a, F, G> where
    F: RefUnwindSafe,
    G: RefUnwindSafe

impl<'a, F, G> Send for PerfBufferBuilder<'a, F, G> where
    F: Send,
    G: Send

impl<'a, F, G> Sync for PerfBufferBuilder<'a, F, G> where
    F: Sync,
    G: Sync

impl<'a, F, G> Unpin for PerfBufferBuilder<'a, F, G>

impl<'a, F, G> UnwindSafe for PerfBufferBuilder<'a, F, G> where
    F: UnwindSafe,
    G: UnwindSafe

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.